473,657 Members | 2,435 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Referencing User controls from content pages using ContentPlaceHol ders

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 ContentPlaceHol ders 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 ContentPlaceHol der.

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
ContentPlaceHol der?

Am I missing something here? : )

Thanks in advance
jd

Nov 5 '07 #1
0 1131

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1810
by: Mark | last post by:
I am setting up an asp.net site using the Ektron CMS. Every page in the site uses the same basic template, with the look of the page changing via CSS and an id on the body. The id is shared by all pages in a subsection, e.g. everything in /about/ needs to have <body id="about">. In the past what I've done is set a global variable in index.asp, then include the template to render the page: <% pageid = "about"
20
2417
by: Alan Silver | last post by:
Hello, In classic ASP, I used to use two include files on each page, one before and one after the main content, to provide a consistent layout across a web site. That way I could just change the include files to change the layout. When I came to ASP.NET, I used user controls to do a similar thing. I have just been looking at master pages, and it looks like they do the same thing. If so, is there any advantage in using them over the...
5
4078
by: Segfahlt | last post by:
I need a little help here please. I have 2 win forms user controls in 2 different projects that I'm hosting in 2 different virtual directories. The controls have been test and operate okay in both projects. Both controls(dlls) have been signed using SN.exe and I've set up the appropriate .Net assembly permissions using those Strong Names The DLL's have been copied to the /bin directory in both web virtual directories.
2
3078
by: Scott | last post by:
I'm using a master page (mp_TableMaint.aspx) with one Content area (ID: Content1). Content1 contains several usercontrols, which are hidden. The goal is to show the correct control based on the querystring passed when calling mp_TableMaint (the page is called from an ASP.NET 2.0 Menu control on my index.aspx page). I believe I understand correctly that the Master Page's ASP Content control (named Content1) is, itself, a server side...
2
1857
by: tshad | last post by:
User VS 2003, I would like to use User Controls to control the page look with 3 User Controls (...PageTop.ascx, ...NavigateTop.ascx and PageBottom.ascx). I would put the Content User control between the NavigateTop and PageBottom User controls. These files be something like: sdhcPageTop.ascx, ft2PageTop.ascx, sbPageTop.ascx, macPageTop.ascx etc. I would have the same files for the NavigateTop.ascx and PageBottom.asc. The ones that...
7
8700
by: xkeops | last post by:
Thinking of creating a website, most of the pages will have a general toolbar menu, a content and a footer. The content will be the only one who's gonna change but the rest (header,footer) will remain the same. I am interested to know your opinions/suggestions in finding an easy way of doing it. In asp one could have something like this:
0
1702
by: dhurwitz | last post by:
Hi, In my ASP.NET 2.0 web app, I have a user control, ucBinEdges, with several text boxes. The user control has several validation controls validating the Text of these text boxes - CompareValidator, RangeValidator, RequiredFieldValidator, and a ValidationSummary. The page using ucBinEdges is a content page working in conjunction with a master page. The master page defines two ContentPlaceHolders: cphLeftNav and cphReportContent. ...
1
1243
by: | last post by:
Hey all! I'm new to 2.0. I use user controls, and since 99% of browsers have css now, I use absolute positioning to place my user controls.(Top banners, menus on the left side etc). In my case, what is the advantage of Master/Content? I could see it if I used tables for my pages... Don't user controls do most of what Master/Content does? Tks Justin Dutoit
2
5537
by: Paras | last post by:
Hi, I have 3 ContentPlaceHolders in the MasterPage. In the 2nd content I have placed a usercontrol which has anchor link. This loads another page (without changing loading the content of ContentPlaceHolder1). But currently this is getting posted back. I have tried in a separate application and tried with 2 ContentPlaceHolders (without user control) by implementing UpdatePanel. That works fine. But with user control it is getting...
0
8310
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8826
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6166
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4155
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1955
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1615
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.