however when I then submit the form no data is passed even though the textbox contains data:
The code is as follows:
.aspx page
<asp:Repeater id="rptForums" Runat="Server" OnItemCommand="Item_Button_Click" runat="Server">
<ItemTemplate>
<li/>
<asp:LinkButton Text='<%#Container.DataItem("forum_name"%>' CommandArgument='<%#Container.DataItem("id"%>' Runat="Server"/>
</ItemTemplate>
</asp:Repeater>
<asp:Button id="btnUpdateLibrary" Text="Update" OnClick="Button_Click" Runat="Server" />
<asp:TextBox id="inputForumChoice" Runat="Server" />
apsx.vb file:
Public Sub Item_Button_Click(s As Object, e As RepeaterCommandEventArgs )
'pnlSubmit.Visible = True
Dim lbLink As LinkButton = e.Item.Controls(1)
Dim iForumID as String = lbLink.CommandArgument
Dim strForumName As String = lbLink.Text
inputForumChoice.ID = iForumID
inputForumChoice.Text = strForumName
End Sub
Public Sub Button_Click(Sender As Object, E As EventArgs )
Dim strForumInput As String = inputForumChoice.Text
'pnlSubmit.Visible = False
if ( strForumInput.Length = 0 ) then
lblMessage.Text += " zero length "
else
lblMessage.Text += " not zero "
end if
End Sub
Any help really appreciated
The code is as follows:
.aspx page
<asp:Repeater id="rptForums" Runat="Server" OnItemCommand="Item_Button_Click" runat="Server">
<ItemTemplate>
<li/>
<asp:LinkButton Text='<%#Container.DataItem("forum_name"%>' CommandArgument='<%#Container.DataItem("id"%>' Runat="Server"/>
</ItemTemplate>
</asp:Repeater>
<asp:Button id="btnUpdateLibrary" Text="Update" OnClick="Button_Click" Runat="Server" />
<asp:TextBox id="inputForumChoice" Runat="Server" />
apsx.vb file:
Public Sub Item_Button_Click(s As Object, e As RepeaterCommandEventArgs )
'pnlSubmit.Visible = True
Dim lbLink As LinkButton = e.Item.Controls(1)
Dim iForumID as String = lbLink.CommandArgument
Dim strForumName As String = lbLink.Text
inputForumChoice.ID = iForumID
inputForumChoice.Text = strForumName
End Sub
Public Sub Button_Click(Sender As Object, E As EventArgs )
Dim strForumInput As String = inputForumChoice.Text
'pnlSubmit.Visible = False
if ( strForumInput.Length = 0 ) then
lblMessage.Text += " zero length "
else
lblMessage.Text += " not zero "
end if
End Sub
Any help really appreciated