Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

i'm using click on a link button to populate a text box

Status
Not open for further replies.

mit99mh

Programmer
Sep 24, 2002
246
GB
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=&quot;rptForums&quot; Runat=&quot;Server&quot; OnItemCommand=&quot;Item_Button_Click&quot; runat=&quot;Server&quot;>
<ItemTemplate>
<li/>
<asp:LinkButton Text='<%#Container.DataItem(&quot;forum_name&quot;)%>' CommandArgument='<%#Container.DataItem(&quot;id&quot;)%>' Runat=&quot;Server&quot;/>
</ItemTemplate>
</asp:Repeater>

<asp:Button id=&quot;btnUpdateLibrary&quot; Text=&quot;Update&quot; OnClick=&quot;Button_Click&quot; Runat=&quot;Server&quot; />
<asp:TextBox id=&quot;inputForumChoice&quot; Runat=&quot;Server&quot; />

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 += &quot; zero length &quot;
else
lblMessage.Text += &quot; not zero &quot;
end if


End Sub

Any help really appreciated
 
mit: haven't tested your code; try first enabling viewstate in the textbox:

<asp:TextBox id=&quot;inputForumChoice&quot; EnableViewState=&quot;true&quot; Runat=&quot;Server&quot; />

..see if that helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top