Tuesday, March 27, 2012

Binding a texbox to a SQLDataSource

This is an easy question. I thought I have databinded a textbox to a SQLDataSource. But now I do not see how to do that now. Can somebody help with this?

Thanks,

Hi Salportaro,

We can bind the TextBox.Text to a property using expressions like

<asp:TextBox ID="TextBox1" runat="server" Text=<%#XXXXXXX%>></asp:TextBox>

However, it is only to properties. The TextBox cannot be bound to a SqlDataSource directly. It has to be put in a container like Repeater, FormView or DetailView.

HTH.

No comments:

Post a Comment