ASPnetNovice
Programmer
Hello,
I will like to ask if someone knows how to loop through all of the controls of a webform and populate the text boxes with a value like "hello world" .
This is the code that I am trying but it doesn work
Dim child As Control
For Each child In Me.Controls
If (child.GetType().ToString().Equals ("System.Web.UI.WebControls.TextBox")) Then
Dim tb As TextBox = CType(child, TextBox)
tb.Text = "hello world"
End If
Next
The loop (Each child In Me.Controls) is not looping through all my controls as I am expecting
I will apreciate any help
I will like to ask if someone knows how to loop through all of the controls of a webform and populate the text boxes with a value like "hello world" .
This is the code that I am trying but it doesn work
Dim child As Control
For Each child In Me.Controls
If (child.GetType().ToString().Equals ("System.Web.UI.WebControls.TextBox")) Then
Dim tb As TextBox = CType(child, TextBox)
tb.Text = "hello world"
End If
Next
The loop (Each child In Me.Controls) is not looping through all my controls as I am expecting
I will apreciate any help