Find Controls in Repeaters
This usually happens to me. I have a repeater
object, do a "FindControl" to look for a textbox, and can't find
it. Ends up null each time.
So, tired of finding complex workarounds...I finally researched this issue.
Here's the solution:
Ahhh....makes much sense
Must love the internet
Source: http://www.odetocode.com/articles/116.aspx
So, tired of finding complex workarounds...I finally researched this issue.
Here's the solution:
| Code: |
| foreach(RepeaterItem item in Repeater1.Items)
{ TextBox b = item.FindControl("TextBox1") as TextBox; Response.Write(b.Text + "<br>"); } |
Ahhh....makes much sense
Must love the internet
Source: http://www.odetocode.com/articles/116.aspx


Comments