Retrieving values from dynamic controls

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have dynamically created n number of text boxes in a form like txtQL(1),
txtQL(2) , ...txtQL(n)
How I retrieve the values in a loop? I'm confused as to how to approach
this! Please help.

Thanks for your time.
 
I get the error "Referenced object has a value of 'Nothing'". as indicated in
the code below:

For Each c In Controls
If i < maxRow Then
Error txtQLLink(i) = c.FindControl("txtQLLink(" + i & ")")
txtQLUrl(i) = c.FindControl("txtQlUrl(" + i & ")")
If txtQLLink(i).Text <> "" Then
textQLHtml = textQLHtml & txtQLUrl(i).Text & txtQLLink(i).Text
strQL = strQL & txtQLLink(i).Text & "," & txtQLUrl(i).Text
i += 1
End If
End If
Next


I created the controls dynamically! But cant seem to figure out how to
retrieve it dynamically?!! Please help.
 
Back
Top