By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,877 Members | 1,102 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,877 IT Pros & Developers. It's quick & easy.

Recursively Iterate All Form/Panel Controls On A Page

P: n/a
How do you recursively iterate thru each collection on each form on a web
page and find each web control?

--
Thank you kindly,
Dan Sikorsky BAB, BScE, MSC
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Here's a solution:

Private Sub IterateControls(ByRef ctlParent As Control)
Dim ctlControl As Control

For Each ctlControl In ctlParent.Controls
Select Case ctlControl.GetType.ToString
Case "System.Web.UI.WebControls.TextBox"

Case "System.Web.UI.WebControls.RadioButtonList"

Case "System.Web.UI.WebControls.DropDownList"

End Select
If ctlControl.HasControls Then
IterateControls(ctlControl)
End If
Next
End Sub

Thank you kindly,
Dan Sikorsky BAB, BScE, MSC

"Dan Sikorsky" <ds****@gte.net> wrote in message
news:up**************@TK2MSFTNGP14.phx.gbl...
How do you recursively iterate thru each collection on each form on a web
page and find each web control?

--
Thank you kindly,
Dan Sikorsky BAB, BScE, MSC

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.