我没有收到任何错误,但我无法从TextBox
获取值。
这是我用于读取TextBox
值的VB代码:
Private Sub btn_Save_Click(sender As Object, e As EventArgs) Handlesbtn_Save.Click
For Each item As RepeaterItem In Article_Block_Migrated.Items
Dim txtField As Label = item.FindControl("Article_Number")
Dim a = txtField.Text
Dim txtField1 As TextBox = DirectCast(item.FindControl("txt_DWPDate"), TextBox)
Dim b = txtField1.Text
Next
End Sub
这是Repeater
:
<asp:Repeater ID="Article_Block_Migrated" runat="server">
<ItemTemplate>
<asp:TextBox Width="80px" ID="txt_DWPDate" runat="server" MaxLength="50"></asp:TextBox>
</ItemTemplate>
</asp:Repeater>