无法从“Repeater”

时间:2018-03-16 10:14:58

标签: asp.net vb.net repeater

我没有收到任何错误,但我无法从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代码
<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>

0 个答案:

没有答案