The Master Page file is not valid. Attach a different Master Page, or correct the problem in the specified Master Page.

 Hi all,

I've created a site with a couple of nested Master Pages. Site runs and compiles without error. I need to get it set up in Expressions now so that the non-technical content creators are able to edit it but when I try to attach a Master Page to a newly created file, it just hangs with 'Loading Master Page...'. If I subsequently detach the Master Page, it shows the error:

The Master Page file 'http://localhost/layout/images/masterpages/SectionInnerPageChild.Master' is not valid. Attach a different Master Page, or correct the problem in the specified Master Page.

 Does anyone know how I can check what the problem with this might be?

Thanks and kind regards

Shivonne
 

0
Shivonne
11/11/2007 10:16:09 PM
asp.net.navigation-controls 13714 articles. 0 followers. Follow

4 Replies
2609 Views

Similar Articles

[PageSpeed] 16

Hi,

Shivonne:

I need to get it set up in Expressions now so that the non-technical content creators are able to edit it but when I try to attach a Master Page to a newly created file,

Cannot understand you very clearly, could you please post more details about your problem? Or could you please post some code here, so we can repro your problem as possible as we can, which helps to find the solution. 


Amanda Wang
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
0
Amanda
11/13/2007 9:14:26 AM

 Hi Amanda

 I have created a website in Visual Studio 2005 that now needs to be opened in Expressions so that the people who are not developers, but who maintain the site content are able to edit it. The site builds fine in Visual Studio and runs fine.

When I try to edit Content pages in Expression Web, however, the page just hangs on 'Loading Master Page...'. If I detach the Master Page, it gives me the error:

The Master Page file
'http://localhost/layout/masterpages/SectionInnerPageChild.Master' is not
valid. Attach a different Master Page, or correct the problem in the
specified Master Page.

 

My question is how do I find out what the problem in the Master Page is? There are no errors in Visual Studio or in Expression Web.

Here is the code for the Master Page:

 

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="SectionInnerPageChild.master.cs" Inherits="ANZNational.Internet.layout.masterpages.SectionInnerPageChild" masterpagefile="~/layout/masterpages/SectionPage.Master" %>

<asp:content id="metaContent" runat="server" contentplaceholderid="_metaContent">
<asp:contentplaceholder id="_metaContent" runat="server"></asp:contentplaceholder>
</asp:content>

<asp:content id="leftHandNavigationContent" runat="server" contentplaceholderid="_leftHandNavigationContent">
<asp:sitemapdatasource id="smdLeftHandNavigation" runat="server" />
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<asp:repeater id="rptLeftHandNavigationContainer" runat="server" datasourceid="smdLeftHandNavigation">
<itemtemplate>
<tr>
<td class="lhNavLvl2" style="width: 15px; vertical-align: top;">
<img src="/layout/images/navigation/leftnav-off-mark.gif" alt="" id="leftNavImage<%# Eval("Title").ToString().Replace(" ", "") %>" />
</td>
<td class="lhNavLvl2" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('leftNavImage<%#Eval("Title").ToString().Replace(" ", "") %>','','/layout/images/navigation/leftnav-<%#GetSection(Request.Url.OriginalString) %>-on-bullet.gif',1)"><a href="<%# Eval("URL") %>" class="lhNavLvl2 lhNavLvl2NotSelected"><asp:literal id="litDescription" runat="server" text='<%# Eval("Description") %>'></asp:literal></a></td>
</tr>
<asp:repeater id="rptLeftHandNavigation" runat="server" datasource="<%#((SiteMapNode)Container.DataItem).ChildNodes %>">
<itemtemplate>
<asp:literal id="litContent" runat="server" text='<%# GetNavigationString((SiteMapNode)Container.DataItem) %>'></asp:literal>
</itemtemplate>
</asp:repeater>
</itemtemplate>
</asp:repeater>
</table>
</asp:content>

<asp:content contentplaceholderid="_leftHandPictureContent" runat="server" id="leftHandPictureContent">
<asp:contentplaceholder id="_leftHandPictureContent" runat="server"></asp:contentplaceholder>
</asp:content>

<asp:content contentplaceholderid="_mainContent" id="mainContent" runat="server">
<asp:contentplaceholder id="_mainContent" runat="server"></asp:contentplaceholder>
</asp:content>

<asp:content contentplaceholderid="_rightHandContent" id="rightHandContent" runat="server">
<asp:contentplaceholder id="_rightHandContent" runat="server"></asp:contentplaceholder>
</asp:content>

 Thanks as always

Shivonne 

0
Shivonne
11/13/2007 7:16:07 PM

Hi Shivonne,

I understand your problem, firstly I assume you have Expression Web, because thats what you will need. Please have a look at this tutorial http://www.microsoft.com/expression/kc/resources.aspx?product=web&type=video

I also assume you have the latest patch, because I have read about people having problems with Master pages in Expression. The only other alternative is save the page as .aspx for editing and saving it back as .master..

 

Good luck 

 


Please Mark Post that helped you as answer, also include a summary of what solved the problem as it helps others in similar situations
0
naturehermit
11/14/2007 11:09:41 AM

Hi naturehermit

Yes I do have Expression Web - and have applied the latest patch. Still no luck - this seems to happen to different Master Pages every time I open the site. I've created another, more complex, site before that doesn't have these problems.

If I edit the page (just by adding a space) in Split view and click in the preview of the page, it bounces to that error where it prompts me to correct the error in the Master Page. If I then open the Master Page, add a space anywhere in the page and save it, it all works fine and the error disappears??

Any thoughts?

Thanks as always

Shivonne 

0
Shivonne
11/16/2007 2:10:47 AM
Reply:

Similar Artilces:

HELP..... Master Page Error (The page has controls that require a Master Page, but none is specified.)
Hi, I had almost finished creting my master page to use as a template for all future internal applications.  I had created a template to use in creatign new applications and had sucessfully created a new project based upon the MasterPage template... All was working well when I noticed a small graphic inconsistancy on the MasterPage... I reopened the MasterPage and I got teh above error message... I have looked at the HTML and everything seems to be okay and there including the header lines... <%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits=&qu...

Content controls have to be top-level controls in a content page or a nested master page that references a master page.
Why in the world am I getting this error? The solutions I have seen either don't apply or don't work.  Here is my master page code:<%@ Master Language="C#" AutoEventWireup="false" CodeFile="TechLMSMasters/MainSide.master.cs" Inherits="MainSide" %> <%@ Register TagPrefix="usercontrol" TagName="Search" Src="~/library/uc/Search.ascx" %> <%@ Register TagPrefix="usercontrol" TagName="UserName" Src="~/library/uc/UserNameDisplay.ascx" %><!DOCTYPE html PUBLI...

ERROR Content controls have to be top-level controls in a content page or a nested master page that references a master page.
This all used to work until about 5 minutes ago. Did I change something? For some reason I am now getting this error: Content controls have to be top-level controls in a content page or a nested master page that references a master page. What I have:  I have a masterpage inside of a directory. That directory is a first level directory with its own web.config file....The whole thing is protected by the web.config file above it (in the main public directory). That main public directory has a masterpage as well. I am not currently linking the two masterpages together becuase...

Error : Content controls have to be top-level controls in a content page or a nested master page that references a master page.
when I make a directory on my root, and in that directory I put a masterpage and a web form ... I get always an error : Content controls have to be top-level controls in a content page or a nested master page that references a master page.   Does somebody know what the problem is ? Is it possible you can't set a masterpage in a directory ... ?Kind Regards,Joeri Pansaerts.From Bruges, Belgium :) i've founded ... I had to nest my masterpage ...Kind Regards,Joeri Pansaerts.From Bruges, Belgium :) Hi Joeri Pansaerts, I am receiving the same error as the one posted her...

Problem Accessing Page Controls in a page that has a master page.
Hi,  I have a problem with accessing the controls of a page that has a masterpage. I am trying to access the Page.Controls from the code behind in the class file but no controls are returned.I can access single controls (ex. txtAddress.Text) but not the whole array of controls (ex. Page.Controls).  The controls structure is..                                 MasterPage  >  PlaceHolder > MyPage.aspx &n...

synchronizing content pages to master page when master page is edited
 Hi Guys,I'm new to designing websites so please forgive this basic question.I've updated my master page and the modfications ( adding a couple of extra place holders)  are not reflecting in the content pages.Is there any way we can update the content pages created before the changes to the master page were made.Thanks a lot  :)  abhinaynag: I'm new to designing websites so please forgive this basic question. I've updated my master page and the modfications ( adding a couple of extra place holders)  are not reflecting in the content pages. Is t...

2 master pages/both loades irrespective of the pages master page
I have 2 master pages One in application’s root directory and one in Admin folder  all .aspx file on the   Admin folder uses AdminMaster.Master  the same folder.  all file  in application’s root directory   uses Open.master in in application’s root directory itself I have noticed one thing when I browse a page with master page AdminMaster.Master   the  events in Open.master    (Page_Init, Page_Load) also executes ! why it is sowhat can I do to avoid this problem ?         ...

Dynamic Master Page File
I want to dynamically set the Master Page File for my View, but I'm not sure how (or where) to do this.  Can I set it from my Control or do I need to create a codebehind file for the View that does this?  Thanks for your help. hi,add this code in page load of your page this.MasterPageFile = "your new master page file path";  Regards,Ravi Kishore.ChMark as "ANSWER" if you got the solution from this post. http://www.dotnetjunkies.com/WebLog/leon/archive/2006/03/01/135665.aspx  Regards,Stefan Uzunov The proper place to do this i...

Change a Master Page from a Master Page
Hello, I have 2 master pages, the default one and the one for printing.  I would like to be able to put a print button or link in the default masterpage and have it change the masterpage to the print version.  Is this possible?  If not, what is the most efficient way to go about doing this? (I would rather not have to change every single content page). Thanks for the help, Brian "I'm more like I am now than I've ever been" Is it possible to do a redirect of some sort and capture the url and just add a querystring parameter to the end that when redirected ...

Changing the master page of the master page
I have two master pages [Inner Master Page]. I want to change the master page of the inner master page according to user type. Research shows that we can only change the master page in Pre_init page handler but the master page does not have any pre_init. Is there any way to change the master page of a master page? Thanks in advance. SyedSyed Ali Shah______________________________________________Attention: Don't Forget to mark as "Answer" If I helped you in solving your problem. It seems that you want to change nested master page dynamically, if so, please check this link, ...

Master page and nested master page
Hi GuysYou have probably heard this question before. I sit and try to create a Master Page with nested Master Page in That I had intended is this: I have a Master Page (globalMaster.Master) which contain the Header and Footer. In the Master Page I have a nested master of the left menu (leftColumnNav.master) and right menu (RightColumnNav.master) In addition, I have Content Placeholder for my content. My problem is that I neither get my left or right menus to show. While the text in the middle (content) is showing fine. I lists the code (yes is f. ..... long) What do I do wrong and is ...

Problem in using validation in Multiple step Wizard in content place holder of master page with scriptmanager and updatepanel definded in Master page.
We have a master page with many content place holders. All placed in ATLAS update panel. In Content page we are using wizard control and we want to do validation on each step of wizard. Problem is that one 1st step is successfully validated and user moves to 2nd step of wizard and after entering data clicks next button. Validation controls used in 1st steps are invoked and causes error.   Master  Page ,,,,,,, <atlas:UpdatePanel ID="AP1" runat="server">        <ContentTemplate>        &nb...

Change content pages of Master Page without Master Page posting back?
so Master + content pages seems like exactly what I want except that they are assembled on postbacks. I am trying to make a site where both Master and Content pages have updatepanels, and the site switches content pages (40+ content pages) without the master page refreshing. Master Pages are assembled on postbacks so I don't think simple master page will work without annoying postbacks. I tried an approach where load content pages inside an Iframe, but the content pages take too long to load becuase each content page loads its own scriptmanager. View/Multiview will probably work but dif...

Can a sub Master page be in a different directory (or project) from its master Page?
Can a sub Master page be in a different directory (or project) from its master Page? The sub master identifies the master using the "~/project" Dir syntax. When I explicitly enter the directory, eg "C:\WebApps\EOISMaster\EOIS.Master" I get the error message "The master page file can not be loaded .... " I have several projects that can use the same master page - each will have its own sub master. Hello,If you want a single master page to be used in all your projects, and then you will use this Master page as master of other Master pages in respective projec...

Web resources about - The Master Page file is not valid. Attach a different Master Page, or correct the problem in the specified Master Page. - asp.net.navigation-controls

Iran sanctions lifted: Good for diplomacy, bad for oil market
On Sunday, a triumphant President Barack Obama praised a historic deal with Iran that successfully curbed the country's nuclear program and paved ...

Foreigners among 23 killed as al-Qaeda militants storm Burkina Faso hotel
The Islamic extremists stormed the hotel and a nearby cafe Friday night.

Seahawks RB Lynch active for playoff game vs. Carolina
CHARLOTTE, N.C. (AP) — The latest from NFL divisional games on Sunday (all times EST):

'Ride Along 2' Dethrones 'Star Wars' at Weekend Box Office!
Kevin Hart and Ice Cube ‘s new comedy Ride Along 2 has topped the Martin Luther King Jr. holiday weekend’s box office with a $39.5 million haul! ...

12 missing Marines identified after helicopters crash in Hawaii
Marine Corps Times 12 missing Marines identified after helicopters crash in Hawaii Marine Corps Times Marine Corps officials have identified ...

Pro-China party likely to lose power in Taiwan election
Tsai supporters appeared confident that ties with China would weather a change in government.

Netflix is bringing 'Jessica Jones' back for a second season
Netflix is determined to start 2016 with a bang. As part of a broader premier announcement, the streaming service has revealed that Jessica Jones ...

Celine Dion's brother dies of cancer only days after her husband
Two days after Céline Dion's husband René Angélil died, it has emerged that her brother, Daniel Dion, also lost his battle with cancer. In a ...

Kate del Castillo’s Netflix Series Still on Track After El Chapo Frenzy, Says Ted Sarandos
Kate del Castillo, the Mexican actress who was the mastermind behind Sean Penn’s interview with El Chapo, is still on track to become a Netflix ...


Resources last updated: 1/17/2016 6:13:26 PM