Data Binding to textbox
-
Hi how can I bind the data to textbox using ASP.NET inline coding? I have implemented data binding to dropdownlist... likewise I want to do data binding to TextBox too.. can someone please guide me? Thanks in advance.
Hi there, You should remember that the TextBox does not have the
DataSource
orDataSourceID
properties as the DropDownList, however you can use the data binding expression to bind to theText
property of the TextBox. It looks something like:<asp:TextBox runat="server" ID="TextBox1" Text="<%# your expression goes here %>" />
and you need to call the
DataBind
method. -
Hi how can I bind the data to textbox using ASP.NET inline coding? I have implemented data binding to dropdownlist... likewise I want to do data binding to TextBox too.. can someone please guide me? Thanks in advance.
While dr.Read lblID.Text = dr("ID") txtJobName.Text = dr("JobName") txtJobDescription.Text = dr("JobDescription") End While
Find the example at http://www.programmingknowledge.com/simpleDataGrid.aspx[^]