I get `System.Web.UI.WebControls.TextBox` instead of TextBox value
- by Anna T
Gooday. Could you help me figure out please why I get this: System.Web.UI.WebControls.TextBox on Label1:
DataListItem item = DataList1.Items[0];
TextBox nume = (TextBox)item.FindControl("numeTb");
Label1.Text = nume.ToString();
I specify that the numeTb element is put like this in the ASPX file:
<asp:TextBox ID="numeTb" runat="server" Width="400px"
Text='<%# Eval("nume") %>' DataTextField="nume" DataValueField="nume"></asp:TextBox>
I just added the DataTextField bits thinking might help, but no. Thank you!