S
Steve F.
Hi, could you please tell me what is wrong with this piece of code.
I have a DataGrid, and I would like to know the value of a textbox field,
and it never returns anything.
textbox is in item template.
<asp:TemplateColumn HeaderText="Value">
<ItemTemplate>
<asp:TextBox id="txtInput" runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateColumn>
Dim item As DataGridItem
If Not IsPostBack Then
For Each item In DataGrid1.Items
Dim tb As TextBox = CType(item.FindControl("txtInput"),
TextBox)
ListBox1.Items.Add(tb.Text)
Next
End If
Thank you.
Steve
I have a DataGrid, and I would like to know the value of a textbox field,
and it never returns anything.
textbox is in item template.
<asp:TemplateColumn HeaderText="Value">
<ItemTemplate>
<asp:TextBox id="txtInput" runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateColumn>
Dim item As DataGridItem
If Not IsPostBack Then
For Each item In DataGrid1.Items
Dim tb As TextBox = CType(item.FindControl("txtInput"),
TextBox)
ListBox1.Items.Add(tb.Text)
Next
End If
Thank you.
Steve