' See if a control ID exists ' expO1 Control ' expC1 ID Public Function IsPageControlExistByID(ByVal toControl As Object, ByVal tcID As String) As Boolean Dim loControl As System.Web.UI.Control = New System.Web.UI.Control ' For each control For Each loControl In toControl.Controls ' If this is the ID If loControl.ID = tcID Then Return True End If ' If we have child controls If loControl.HasControls Then ' If the control exists If IsPageControlExist(loControl, tcID) Then Return True End If End If Next Return False End Function