Link to home
Start Free TrialLog in
Avatar of mathieu_cupryk
mathieu_cuprykFlag for Canada

asked on

3 column dynamic master page. with nest master page.

I have a problem I have a nested master page and I am not sure why I cannot put an ascx
web control in the below code.
I have to put it outside the
<asp:ContentPlaceHolder ID="ContentPlaceholder_RightMenu" runat="server">    
                </asp:ContentPlaceHolder>
in order to see it. please check omegalove.com
I would like to understand why this is not working?
<%@ Master Language="C#" MasterPageFile="~/ParentRoot.master" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>


<%@ Register src="Controls/LeftMenu.ascx" tagname="LeftMenu" tagprefix="uc2" %>

<%@ Register src="Controls/Search/SearchBox.ascx" tagname="SearchBox" tagprefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceholder1" Runat="Server">
    <table border="0" cellspacing="0" cellpadding="0" id="content-container">
        <tr>
            <td id="content-left">
             <uc2:LeftMenu ID="LeftMenu1" runat="server" />
                <asp:ContentPlaceHolder ID="ContentPlaceholder_LeftMenu" runat="server">
                left side  
                </asp:ContentPlaceHolder>
            </td>
            <td id="content">
                <asp:ContentPlaceHolder ID="ContentPlaceholder_Center" runat="server">
                </asp:ContentPlaceHolder>
            </td>
            <td id="content-right">
                <uc1:SearchBox ID="SearchBox1" runat="server" />
                <asp:ContentPlaceHolder ID="ContentPlaceholder_RightMenu" runat="server">    
why can I not place it here.
                </asp:ContentPlaceHolder>
            </td>
        </tr>
    </table>
</asp:Content>


i need to understand why?
<td id="content-right">
                <uc1:SearchBox ID="SearchBox1" runat="server" />
                <asp:ContentPlaceHolder ID="ContentPlaceholder_RightMenu" runat="server">     
                </asp:ContentPlaceHolder>
 </td>

Open in new window

Avatar of CB_Thirumalai
CB_Thirumalai
Flag of India image

The placeholder is for the pages using the Masterpage.  I think even if you place any controls inside it, it will get replaced.
<asp:ContentPlaceHolder ID="ContentPlaceholder_RightMenu" runat="server">    
why can I not place it here.
 </asp:ContentPlaceHolder>

Anything in between the contentplaceholder tags will get replaced on your content pages, unless you delete the content pane that points at it, in which case it will default to the master page content.  If that's the case though, why not just delete the content placeholder and put the user control there?

This is what you would delete on your content pages:
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder_RightMenu" Runat="Server">
</asp:Content>
Avatar of mathieu_cupryk

ASKER

i have to put the ascx in every page.
any other way of doing this?
ASKER CERTIFIED SOLUTION
Avatar of aibusinesssolutions
aibusinesssolutions
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
duh, ok kool.