Wednesday, February 3, 2010

Fecting Page controls Dynamically + vb.net


How to fetch Page controls of web form Dynamically in vb.net

To Find the Page Controls in a Web Page
 
Public Function FindPageControl(ByVal oControlCollection As ControlCollection, ByVal strPageName As StringAsArrayList
        ' Traverses all the controls in the page
        For Each oControl As Control In oControlCollection
            DisplayControlName(oControl, strPageName)
            FindPageControl(oControl.Controls, strPageName)
        Next
        Return ArrayLst
    End Function
How to call this function
 
FindPageControl(Page.Controls, strPgName)

No comments:

Post a Comment