[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

3 column dynamic master page. with nest master page.

Posted on 2009-02-21
5
Medium Priority
?
266 Views
Last Modified: 2012-05-06
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

0
Comment
Question by:mathieu_cupryk
  • 2
  • 2
5 Comments
 
LVL 12

Expert Comment

by:CB_Thirumalai
ID: 23702673
The placeholder is for the pages using the Masterpage.  I think even if you place any controls inside it, it will get replaced.
0
 
LVL 15

Expert Comment

by:aibusinesssolutions
ID: 23703484
<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>
0
 

Author Comment

by:mathieu_cupryk
ID: 23703788
i have to put the ascx in every page.
any other way of doing this?
0
 
LVL 15

Accepted Solution

by:
aibusinesssolutions earned 2000 total points
ID: 23703872
Yeah, just take the content placeholder out of the master page all together, and put the search box there.

 <td id="content-right">
         <uc1:SearchBox ID="SearchBox1" runat="server" />
</td>
0
 

Author Comment

by:mathieu_cupryk
ID: 23705880
duh, ok kool.
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses
Course of the Month19 days, 12 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question