Hi Rex,
Here is some sample code to iterate through all the WebControls on the page and check for the property:
For Each ctrlForm In Me.Controls
If TypeOf ctrlForm Is System.Web.UI.HtmlControls.HtmlForm Then
Dim ctrl As System.Web.UI.Control
For Each ctrl In ctrlForm.Controls
If TypeOf ctrl Is System.Web.UI.WebControls.WebControl Then
If Not (ctrl.GetType().GetProperty("TabIndex") Is Nothing) Then
Response.Write(ctrl.GetType.ToString() + "<br>")
End If
End If
Next
Exit For
End If
Next
>All,
>
>Is there a way to tell if an object on a page has a particular property? I want to iterate through all controls on a page and get the id of the control with the lowest TabIndex. If I get a control that does not have a TabIndex property and try to get it's value I will get an error, so I need to determin if a given control has a TabIndex property.
>
>TIA
>
>Rex
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi