I have a default.aspx file that is tied to the MasterPAge and ContentPlaceHolder1 and displays fine, is there a way to have another page say info.aspx auto display in ContentPlaceHolder2?
A:
Think of ContentPlaceHolder's as "fill-in-the-blanks" for MasterPages. I think what you're looking for is more along the lines of a User Control, which is a piece of content/functionality that you can plug in anywhere you want.
mgroves
2009-07-14 14:57:31
A:
If there a way you can turn the content of Info.aspx into a usercontrol( should be very easy ),
if so this is an easy problem to solve, put that new ascx in the placeholder on the masterpage.
On Master:
<div class="mainContent">
<!-- Each Page Content Will Go Here -->
<asp:ContentPlaceHolder ID="cph_MainContent" runat="server">
</asp:ContentPlaceHolder>
</div>
<div class="bottomContent">
<asp:ContentPlaceHolder ID="cph_BottomContent" runat="server">
<!-- Each Page will Display this UNLESS it referenced this placeholder -->
<!-- Put you INFO.ASCX control here -->
</asp:ContentPlaceHolder>
</div>
then you just comment out or delete the tags for the 2nd place holder on you Content Pages:
<asp:Content ID="Content2" ContentPlaceHolderID="cph_MainContent" runat="server">
you page content
</asp:Content>
<%--
this will make the master use the content inside the holder on its own page
<asp:Content ID="Content3" ContentPlaceHolderID="cph_BottomContent" runat="server">
</asp:Content>
--%>
BigBlondeViking
2009-07-14 15:12:12