P
Peter Afonin
Hello:
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
MyList.ItemCommand
Try
Dim txt As TextBox
txt = CType(e.Item.FindControl("txtDomain"), TextBox)
Dim sDomain As String = txt.Text
Catch ex As Exception
Response.Write(ex.Message)
Finally
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,
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
MyList.ItemCommand
Try
Dim txt As TextBox
txt = CType(e.Item.FindControl("txtDomain"), TextBox)
Dim sDomain As String = txt.Text
Catch ex As Exception
Response.Write(ex.Message)
Finally
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,