I changed my aspx page to use a master page. The problem is that I can no
longer loop through the controls on the content page. My question is how do
you loop through the controls on the master page and how do you loop through
the controls on the content page when the content is inside the ContentHolder
control?
Below is an example of the control loop before using a master page.
Sub FindControlsInWebForm()
Dim strValue As String = ""
'Loop through controls
For Each ctlPage As Control In Page.Controls
If TypeOf ctlPage Is HtmlForm Then
For Each ctlChild As Control In ctlPage.Controls
If TypeOf ctlChild Is Label Then strValue &= "Page.Label.ID = " &
ctlChild.ID & ".ID<br>"
'Panel
If TypeOf ctlChild Is Panel Then
strValue = "Panel.ID = " & ctlChild.ID & ".ID<br>"
For Each ctlGrndChild As Control In ctlChild.Controls
If TypeOf ctlGrndChild Is TextBox Then strValue &=
"Panel.TextBox.ID = " & ctlGrndChild.ID & ".ID<br>"
Next ctlGrndChild
End If
Next ctlChild
End If
Next ctlPage
End Sub
--
Thanks in advance,
sck10