A
Adam Tibi
Hello,
I have this:
MasterPage 1:
<asp:ContentPlaceHolder ID="cphHead" runat="server">
</asp:ContentPlaceHolder>
Some Html...
<asp:ContentPlaceHolder ID="cphBody1" runat="server">
</asp:ContentPlaceHolder>
MasterPage 2:
<asp:ContentPlaceHolder ID="cphHead" runat="server">
</asp:ContentPlaceHolder>
Some Html...
<asp:ContentPlaceHolder ID="cphBody2" runat="server">
</asp:ContentPlaceHolder>
Page:
<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphBody1" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="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 ContentPlaceHolderID. 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 ContentPlaceHolder for it.
I tried, in the page events, to detect the Content controls and eliminate
those that do not have a ContentPlaceHolder 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
I have this:
MasterPage 1:
<asp:ContentPlaceHolder ID="cphHead" runat="server">
</asp:ContentPlaceHolder>
Some Html...
<asp:ContentPlaceHolder ID="cphBody1" runat="server">
</asp:ContentPlaceHolder>
MasterPage 2:
<asp:ContentPlaceHolder ID="cphHead" runat="server">
</asp:ContentPlaceHolder>
Some Html...
<asp:ContentPlaceHolder ID="cphBody2" runat="server">
</asp:ContentPlaceHolder>
Page:
<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphBody1" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="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 ContentPlaceHolderID. 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 ContentPlaceHolder for it.
I tried, in the page events, to detect the Content controls and eliminate
those that do not have a ContentPlaceHolder 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