I have several text boxes (TexBox0, Textboxl1, etc) that I would like to loop through in the code behind. I was able to do this in a a simple web form using the FindControl
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim tb1 As TextBox
For i As Integer = 0 To 1
tb1 = CType(Page.FindControl("TextBox" + i.ToString), TextBox)
MsgBox("TextBox =" + label1.Text)
Next
End Sub
However when I use a web page with a master page it does not work.
First question is there another way to loop through controls in the code behind?
If not is the best way to do it to use FindControl) --- MS says "To access controls in a subordinate naming container, call the FindControl method of that container ...
Go to the complete details ...