Referencing User controls from content pages using ContentPlaceHolders

J

jgdean14

Hi -

We have an Early .NET 2.0 App that was created without Master Pages
about a year ago. We opted for more of a MVC framework and dynamically-
loaded User Controls. We use Custom User-Controls extensively and are
currently researching on refactoring the project (WAP) to use Master
Pages.

One challenge is the fact that since MasterPages are integrated with
content pages in the Init() stage, all of our references to User
Controls placed in Master ContentPlaceHolders have to be made by
traversing the Control tree using FindControl() in the Page's code-
behind class. This will lead to extensive reworking of UC code.

It seems that WebControls do not have this limitation and can be
declared/referenced directly by the Page even when they are placed in
the Master's ContentPlaceHolder.

I think I will be able to create a mechanism to help with traversing
the control tree whether it is in our User control Base class and or
the Page's Base Class. But I am wondering if anyone has dealt with
this before and if there is a way to allow User Controls to be
referenced directly from content Pages even if they are in a Master
ContentPlaceHolder?

Am I missing something here? : )

Thanks in advance
jd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top