473,809 Members | 2,591 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Nested Master and contentplacehol ders

Consider a site with 3 files the purpose of which I hope is evident in
their names: SiteMaster.mast er, threeColumnMast er.Master, which uses
SiteMaster.mast er as its master page and default.aspx which uses
threeColumnMast er.master as it's master page.

The question is can Default.aspx access a ContentPlaceHol der control
defined in SiteMaster.Mast er. It would seem not, but I just want to
double check.

Thanks in advance,

Ralph Shillington

Jul 17 '06 #1
4 1376
You're using "nested" MasterPages and yes, you can still reference a
ContentPlaceHol der in the top-level Master by passing the value of the
ContentPlaceHol der ID to the FindControl method. Referencing controls when
using MasterPages gets laborious to explain. There are very good blogs that
document MasterPages. One of the better if not the best is at
http://OdeToCode.com.
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee. com
URL http://www.metromilwaukee.com/clintongallagher/

"rshillingt on" <rs**********@g mail.comwrote in message
news:11******** *************@7 5g2000cwc.googl egroups.com...
Consider a site with 3 files the purpose of which I hope is evident in
their names: SiteMaster.mast er, threeColumnMast er.Master, which uses
SiteMaster.mast er as its master page and default.aspx which uses
threeColumnMast er.master as it's master page.

The question is can Default.aspx access a ContentPlaceHol der control
defined in SiteMaster.Mast er. It would seem not, but I just want to
double check.

Thanks in advance,

Ralph Shillington

Jul 18 '06 #2
Clinton,

Thanks for the reply. If I understand you correctly, you're suggesting
the only way to get at ContentPlaceHol ders in the hierarchy is through
code. That's a bit unfortunate, but good to know.

Regards,
Ralph Shillington

clintonG wrote:
You're using "nested" MasterPages and yes, you can still reference a
ContentPlaceHol der in the top-level Master by passing the value of the
ContentPlaceHol der ID to the FindControl method. Referencing controls when
using MasterPages gets laborious to explain. There are very good blogs that
document MasterPages. One of the better if not the best is at
http://OdeToCode.com.
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee. com
URL http://www.metromilwaukee.com/clintongallagher/

"rshillingt on" <rs**********@g mail.comwrote in message
news:11******** *************@7 5g2000cwc.googl egroups.com...
Consider a site with 3 files the purpose of which I hope is evident in
their names: SiteMaster.mast er, threeColumnMast er.Master, which uses
SiteMaster.mast er as its master page and default.aspx which uses
threeColumnMast er.master as it's master page.

The question is can Default.aspx access a ContentPlaceHol der control
defined in SiteMaster.Mast er. It would seem not, but I just want to
double check.

Thanks in advance,

Ralph Shillington
Jul 18 '06 #3
Yes, that's exactly what I meant to convey. Enable trace in the content page
and look for controls and you'll see the hierarchy. Read OdeToCode.

<%= Clinton Gallagher

"rshillingt on" <rs**********@g mail.comwrote in message
news:11******** **************@ s13g2000cwa.goo glegroups.com.. .
Clinton,

Thanks for the reply. If I understand you correctly, you're suggesting
the only way to get at ContentPlaceHol ders in the hierarchy is through
code. That's a bit unfortunate, but good to know.

Regards,
Ralph Shillington

clintonG wrote:
>You're using "nested" MasterPages and yes, you can still reference a
ContentPlaceHo lder in the top-level Master by passing the value of the
ContentPlaceHo lder ID to the FindControl method. Referencing controls
when
using MasterPages gets laborious to explain. There are very good blogs
that
document MasterPages. One of the better if not the best is at
http://OdeToCode.com.
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee. com
URL http://www.metromilwaukee.com/clintongallagher/

"rshillingto n" <rs**********@g mail.comwrote in message
news:11******* **************@ 75g2000cwc.goog legroups.com...
Consider a site with 3 files the purpose of which I hope is evident in
their names: SiteMaster.mast er, threeColumnMast er.Master, which uses
SiteMaster.mast er as its master page and default.aspx which uses
threeColumnMast er.master as it's master page.

The question is can Default.aspx access a ContentPlaceHol der control
defined in SiteMaster.Mast er. It would seem not, but I just want to
double check.

Thanks in advance,

Ralph Shillington

Jul 18 '06 #4
In article <11************ *********@75g20 00cwc.googlegro ups.com>,
rshillington <rs**********@g mail.comwrites
>Consider a site with 3 files the purpose of which I hope is evident in
their names: SiteMaster.mast er, threeColumnMast er.Master, which uses
SiteMaster.mas ter as its master page and default.aspx which uses
threeColumnMas ter.master as it's master page.

The question is can Default.aspx access a ContentPlaceHol der control
defined in SiteMaster.Mast er. It would seem not, but I just want to
double check.
The easiest way is to have a contentplacehol der in the child master that
simply refers to the content control in the main master. That's what I
do and it works fine.

HTH

--
Alan Silver
(anything added below this line is nothing to do with me)
Jul 23 '06 #5

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

Similar topics

1
1630
by: Sasha | last post by:
Hi all asp.net proffesionals out there, How do you implement master pages in your applications? What libraries do you use and what have been your experience? Sasha
3
2377
by: Billy Cormic | last post by:
Hello, I am using Visual Studio 2005 Beta for the first time and am having trouble using contentplaceholders. Actually, I am having trouble declaring them. Here is a snap shot of my master page: <%@ master language="C#" %> <html> <head id="Head1" runat="server"> <title>Untitled Page</title>
0
1154
by: Mafuba | last post by:
I'm trying to use data sources with data bound controls on one of my pages that's using a master page. The master page has 2 ContentPlaceHolders, and in my page the data sources are in the first content area, and the data bound controls are in the second. The data bound controls are having a problem seeing the data sources at run time (even though everything is picked up by the visual studio at design time). I get an error message...
4
2471
by: Steve Franks | last post by:
I have this cool nested master page scenario working great. However what is the correct way to be able to access a strongly typed property at the top level master from a content page that has a nested master page between the content page and the top level master? For example, assume the very top level master is called CompanyWide.master. And the nested master page is called DepartmentA.master, which inherits from CompanyWide master. ...
2
2469
by: iturner100 | last post by:
Hi, I've been struggling with this one for a couple of hours without much joy. Basically, I've got a set of nested masterpages (3 as it happens). I'm dynamically generating a new page in code and want to be able to populate the ContentPlaceholders of the inner-most masterpage at run-time.
17
3167
by: Rob R. Ainscough | last post by:
Again another simple concept that appears NOT to be intuitive or I'm just stupid. I've read the WROX book and the example doesn't actually show how the .master page links in the other content pages? Kinda sorta a critical point no? Am I missing something? Rob. P.S. the day I find a book that actually is useful rather than just a
7
8734
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:
1
3484
by: Paulo | last post by:
Hi, how can I divide a master pages in 4 parts? Header, left menu, right side (main) and footer? Just like a frame... On the header will be the a javscript menu, on left a gridview wich the user clicks a item will load the details records on the right (main)... and on the footer something like a logo.... Is this possible to be done? Using VS 2005 .net 2.0 C# Any examples?
7
1327
by: Dwight Johnson | last post by:
I am attempting to use Master Pages in a new website, and finding it troublesome. I also do not see a lot of entries in this group regarding them or their components, such as ContentPlaceHolders. So my question is: do I really want to invest the time to learn Master Page technology, or not? Does anyone have an opinion on this (silly question?) Dwight
0
9722
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9603
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
10643
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
6881
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
5550
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...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4333
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3862
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
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.