Hello.
I'm having a difficult time in figuring out how to support two different master page files which have different number of ContentPlaceHolder controls from a single .aspx. My problem is as follows:
I have 3Col.master
1 <!-- -->
2 <asp:ContentPlaceHolder ID="area1"></asp:ContentPlaceHolder>
3 <asp:ContentPlaceHolder ID="area2"></asp:ContentPlaceHolder>
4 <asp:ContentPlaceHolder ID="area3"></asp:ContentPlaceHolder>
5 <!-- -->
and, 3Col.aspx
1 <!-- -->
2 <asp:Content ID="Content1" ContentPlaceHolderID="area1"></content>
3 <asp:Content ID="Content2" ContentPlaceHolderID="area2"></content>
4 <asp:Content ID="Content3" ContentPlaceHolderID="area3"></content>
5 <!-- -->
to display a 3-column view, and similarly, 2Col.master
1 <!-- -->
2 <asp:ContentPlaceHolder ID="area1"></asp:ContentPlaceHolder>
3 <asp:ContentPlaceHolder ID="area2"></asp:ContentPlaceHolder>
4 <!-- -->
and, 2Col.aspx
1 <!-- -->
2 <asp:Content ID="Content1" ContentPlaceHolderID="area1"></content>
3 <asp:Content ID="Content2" ContentPlaceHolderID="area2"></content>
4 <!-- -->
to display a 2-column view.
I would like to be able to use both 3Col.master and 2Col.master from a single Combined.aspx.
I would like to use the first one for home page and the latter for other content pages. What I cannot achieve is that I cannot use both master pages from a single .aspx as number of Content controls within the proposed Combined.aspx control hierarchy do not necessarily match that of ContentPlaceHolder controls in .master.
Say, I'd like to use 2Col.master for combined.aspx (which should have 3 Content controls as I cannot add them at runtime), and this would prevent ASP.NET from rendering the third content placeholder and cause it to throw an exception.
What shall I do?
Thanks in advance.