Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#ASP.NET
Is there is any way to find the list of usercontrols in aspx page in a master page?
Posted 6-Feb-13 2:12am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Yes, there is. This is how you do it:
foreach (Control ctrl in Page.Controls)
{
    if (ctrl is UserControl)
    {
        //Do whatever you want.
    }
}
  Permalink  
Comments
Kishor Deshpande at 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)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 367
1 Abhinav S 226
2 thatraja 220
3 OriginalGriff 195
4 Peter Leow 160
0 Sergey Alexandrovich Kryukov 8,849
1 OriginalGriff 5,035
2 Peter Leow 3,949
3 Maciej Los 3,535
4 Abhinav S 3,148


Advertise | Privacy | Mobile
Web01 | 2.8.140415.2 | Last Updated 6 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid