Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to get value from a textbox in DataList

Thread Tools

How to get value from a textbox in DataList

Peter Afonin
Posts: n/a

I've never used the DataList before, and I have a problem now:

In the ItemTemplate I put the LinkButton and a TextBox (not databound, I
want the user to be able to type in it). Then I try to retrieve the value of
the textbox by pressing the Linkbutton, like this, pretty much like I do it
in Datagrid:

Private Sub MyList_ItemCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataListCommandEventArgs ) Handles

Dim txt As TextBox
txt = CType(e.Item.FindControl("txtDomain"), TextBox)
Dim sDomain As String = txt.Text
Catch ex As Exception
End Try
End Sub

If I type something in this textbox and press the button, the value is
always an emty string. Perhaps I just don't understand how the Datalist
works. What am I doing wrong?

I would appreciate your help.

Thank you,

Peter Afonin

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How get value textbox in datalist row? VB Programmer ASP .Net 3 11-16-2005 12:57 PM
Textbox value in the edittemplate of a datalist doesn't report the changes Antonio D'Ottavio ASP .Net 2 09-26-2005 03:26 PM
Setting up a datalist control - Item_DataBound for a datalist in a datalist Nevyn Twyll ASP .Net 8 09-09-2004 10:13 PM
How to get value from a textbox in DataList Peter Afonin ASP .Net Web Controls 0 04-07-2004 01:47 AM