473,569 Members | 2,698 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Content Controls Problem in ASP.NET 2.0

Hello,

I have this:

MasterPage 1:
<asp:ContentPla ceHolder ID="cphHead" runat="server">
</asp:ContentPlac eHolder>
Some Html...
<asp:ContentPla ceHolder ID="cphBody1" runat="server">
</asp:ContentPlac eHolder>

MasterPage 2:
<asp:ContentPla ceHolder ID="cphHead" runat="server">
</asp:ContentPlac eHolder>
Some Html...
<asp:ContentPla ceHolder ID="cphBody2" runat="server">
</asp:ContentPlac eHolder>

Page:
<asp:Content ID="Content1" ContentPlaceHol derID="cphHead" runat="Server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHol derID="cphBody1 " runat="Server">
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHol derID="cphBody2 " runat="Server">
</asp:Content>
I need to load different MasterPage based on some factors, when I try to
load MasterPage 1, I get that the page "Content3" control points to an
invalid ContentPlaceHol derID. This error is logical and expected, however,
how can I turn this behaviour so that I don't want to show "Content3" in
case the MasterPage doesn't contain a ContentPlaceHol der for it.

I tried, in the page events, to detect the Content controls and eliminate
those that do not have a ContentPlaceHol der in the masterpage, but I failed
to detect the Content controls and I knew why when I've read:
http://msdn2.microsoft.com/en-us/library/c8y19k6h.aspx
Because the Content controls do not belong to the page!

Please if you have any solution or ideas for this, then hit me with it!

Thank you in advance,
Adam Tibi
Feb 17 '06 #1
0 1089

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

Similar topics

2
1137
by: Jill Graham | last post by:
Hi, I have following problem : My .aspx file contains following html code : <table id="t1" cellspacing="0" cellpadding="0" runat="server"> <tr>
7
1479
by: Andrew Robinson | last post by:
Given HTML text (likely from SQL), is there any method that could be employed to render server and/or custom controls that are contained inside of that text? I would be loading content from a database and would like to 'expand' the server controls. Possibly even recursively. Hope this makes sense, but I am guessing the answer is no. If...
2
11848
by: hazz | last post by:
putting a custom control in an aspx page that inherits from a master page is not working out for me. Any tips after getting that error? Also Element 'Search' is not a known element. This can occur if there is a compilation error in the Web site. <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"...
0
1581
by: nickster | last post by:
For some reason when I use asp controls for the default content of a ContentPlaceHolder, they do not get rendered. Static content is rendered just fine however! Specifically I'm using multiple <asp:Image> and <asp:HyperLink> controls and when I copy & paste them into a regular page, they work fine. When I paste them into the Master page's...
5
1859
by: Alex Maghen | last post by:
Hi. If I create a WebControl (User Control, actually), I know how, easily, to access the design-time Properties that have been set as Propertiy nodes in the tag used on the ASPX page. But I've never tried having CONTENT inside my Control's Tag, e.g.: <Ax:MyCtl id="Something" runat="server"> Some stuff inside the tag </Ax:MyCtl> How do I...
0
1549
by: Kevin Frey | last post by:
We have a data-centric application where all of the "layout" for each data centric page is to be codified (ie. it is expressed in C# code rather than being expressed declaratively). This codification subsequently produces the required web-controls for a page based on whether the page is eg. in view or update mode, examination of the user's...
4
11226
by: Phil | last post by:
Hi, How to add programmatically a label into a content page? I tried this but doesn't work: Thanks Phil content page:
4
2826
by: bashetty | last post by:
Well its a strange problem i have, some of you might already faced it and have a solution. I have to maintain a set of unique "search key words" in meta tags for each content page in my site. With master paging , i guess i can only have <headtag in my MasterPage. Can any one let me know how to resovle this issue?
0
1907
by: e_spork | last post by:
I am using Page.ClientScript.RegisterStartupScript to throw up a Javascript alert box. When I click OK on the alert box, all the controls on my page disappear and I don't understand why. I can View Source in the browser and see all the controls so I know they are there, yet they vanish once I click OK. This is happening on a Content page. ...
0
7612
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...
0
7924
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. ...
0
8120
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...
1
7672
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7968
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...
0
6283
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3653
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...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2113
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

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.