' Loop through all the controls on the page and apply the business logic ' expO1 Control Public Function PageControlRecursiveLoop(ByVal toControl As Object) As Boolean Dim lcKey As String = "" Dim lcID As String = "" Dim lcMessage As String = "" Dim loControl As System.Web.UI.Control Dim loControlButton As System.Web.UI.WebControls.Button Dim loControlForm As System.Web.UI.HtmlControls.HtmlForm Dim loControlImage As System.Web.UI.WebControls.Image Dim loControlImageMap As System.Web.UI.WebControls.ImageMap Dim loControlLabel As System.Web.UI.WebControls.Label ' Label values For Each loControl In toControl.Controls ' Label If TypeOf loControl Is System.Web.UI.WebControls.Label Then loControlLabel = CType(loControl, System.Web.UI.WebControls.Label) lcID = loControlLabel.ID End If ' Button If TypeOf loControl Is System.Web.UI.WebControls.Button Then loControlButton = CType(loControl, System.Web.UI.WebControls.Button) lcID = loControlButton.ID End If ' Image If loControl.GetType().ToString = "System.Web.UI.WebControls.Image" Then loControlImage = CType(loControl, System.Web.UI.WebControls.Image) End If ' Image MAP If loControl.GetType().ToString = "System.Web.UI.WebControls.ImageMap" Then loControlImageMap = CType(loControl, System.Web.UI.WebControls.ImageMap) End If ' Form If loControl.GetType().ToString = "System.Web.UI.HtmlControls" Then loControlForm = CType(loControl, System.Web.UI.HtmlControls.HtmlForm) End If ' If we have child controls If loControl.HasControls Then PageControlRecursiveLoop(loControl, tcAlias) End If Next Return True End FunctionI removed some logic in each of the control type. But, this should give you a good idea on how to process them.