Click here to Skip to main content
15,867,756 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Is there is any way to find the list of usercontrols in aspx page in a master page?
Posted

1 solution

Yes, there is. This is how you do it:
C#
foreach (Control ctrl in Page.Controls)
{
    if (ctrl is UserControl)
    {
        //Do whatever you want.
    }
}
 
Share this answer
 
Comments
Kishor Deshpande 6-Feb-13 10:47am    
My 5 :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900