M
MattB
I think I'm close to making this work, but so far it does not.
I have a datalist (id = "dlVFields") on a web form that has an item template
with a textbox in it. The textbox id = "txtVerify". When the form is
submitted via a button click (button is outside datalist) I loop through the
datalist's DataListItem collection to retrieve any values entered into the
textboxes. My problem is that I'm not getting anything back from the
textboxes when they have had text entered into them. I'm sure it's the way
I'm referencing them.
All the examples I've found are driven by events within the datalist, and
mine is not.
Here's what I'm currently trying:
For Each dlitem In dlVerify.Items
Dim strField As String = dtVFields.Rows.Item(i).Item("Field")
Dim tb As TextBox = CType(dlitem.FindControl("txtVerify"), TextBox)
txtInput = tb.txt
i = i + 1
Next
------------------------
It seems that tb.text is always = "". Can anyone tell me how to correctly
reference that control in this context? Thanks!
Matt
I have a datalist (id = "dlVFields") on a web form that has an item template
with a textbox in it. The textbox id = "txtVerify". When the form is
submitted via a button click (button is outside datalist) I loop through the
datalist's DataListItem collection to retrieve any values entered into the
textboxes. My problem is that I'm not getting anything back from the
textboxes when they have had text entered into them. I'm sure it's the way
I'm referencing them.
All the examples I've found are driven by events within the datalist, and
mine is not.
Here's what I'm currently trying:
For Each dlitem In dlVerify.Items
Dim strField As String = dtVFields.Rows.Item(i).Item("Field")
Dim tb As TextBox = CType(dlitem.FindControl("txtVerify"), TextBox)
txtInput = tb.txt
i = i + 1
Next
------------------------
It seems that tb.text is always = "". Can anyone tell me how to correctly
reference that control in this context? Thanks!
Matt