.

The page has one or more controls that do not correspond with controls in the Master Page.

Solving the following Error message:

The page has one or more
<asp:Content> controls that do not correspond with
<asp:ContentPlaceHolder> controls in the Master Page.

I found the problem is more likely to suddenly arise in the master page
(especially if you suddenly have a few pages reporting this problem in design
mode.

Best approach for me was:
1) go to master page
2) edit – advanced – format document
3) view in design mode (I basically saw a blank page)
4) make sure all tags are closed e.g. <title /> or <title>MYTITLE</title>
5) I removed (CUT TO CLIPBOARD) everything between <head> … </head>
6) Save it and close all, then open a page using this master page to see if it works.

IT IS IMPORTANT TO SAVE AND CLOSE ALL – SINCE THERE
IS A PROBLEM WITH CACHING IN VS2008 AND YOU WON'T NECESSARILY SEE THE ERROR
INSTANTLY.

I noticed this didn't make any difference, so I
6) pasted it back (PASTE)
7) after trail and erroring – I realized the problem was trying to move my google-analytics scripts into a seperate external .JS file

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>

 

Goodluck with finding your problem and hope this helps!

regards,
Pietman Celliers

 

3 Responses to this post.

  1. Posted by Shawn on 28.10.08 at 6:46 pm

    I had this same issue, you do not post the solution to moving JavaScript to external files.

    Visual Studio didn’t like the inline closing of the JavaScript src tag.

    I changed from:
    <script src="ant.js" type="text/javascript" />
    to this:
    <script src="ant.js" type="text/javascript" >
    </script>

    And this solved. On a side note, this was also a problem in MSFT Expression Web.

  2. Posted by Sean on 28.10.08 at 6:46 pm

    Having the same issue and I did what everyone else has been suggesting my my error was because of a <iframe> tag in the master page

    "<iframe id="keepAlive" src="KeepSessionAlive.aspx" frameborder="0" width="0" height="0" runat="server" />"

    Commented it out and it now works.

    FYI – I’m using VS2010

  3. Posted by pietman on 28.10.08 at 6:46 pm

    Thanks for the additional info!

What's your thoughts on this?

*

Protected by WP Anti Spam