Answered Error using master page in Sharepoint 2010

  • Monday, December 06, 2010 1:30 PM
     
     

    Hi,
     
    I have following Master Page File:
     
    <%@Master language="C#"%>
    <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
    <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register TagPrefix="wssuc" TagName="Welcome" src="~/_controltemplates/Welcome.ascx" %>
    <%@ Register TagPrefix="wssuc" TagName="MUISelector" src="~/_controltemplates/MUISelector.ascx" %>
    <%@ Register TagPrefix="wssuc" TagName="DesignModeConsole" src="~/_controltemplates/DesignModeConsole.ascx" %>
    <html lang="<%$Resources:wss,language_value%>" dir="<%$Resources:wss,multipages_direction_dir_value%>" runat="server" xmlns:o="urn:schemas-microsoft-com:office:office" __expr-val-dir="ltr">
    <head runat="server">
     <meta name="GENERATOR" content="Microsoft SharePoint" />
     <meta name="progid" content="SharePoint.WebPartPage.Document" />
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     <meta http-equiv="Expires" content="0" />
     <SharePoint:RobotsMetaTag runat="server"></SharePoint:RobotsMetaTag>
     <link href="/_layouts/styles/page.css" rel="stylesheet" type="text/css">
     <link href="/_layouts/styles/top.css" rel="stylesheet" type="text/css">
     <link href="/_layouts/styles/left.css" rel="stylesheet" type="text/css">
     <link href="/_layouts/styles/middle.css" rel="stylesheet" type="text/css">
     <link href="/_layouts/styles/right.css" rel="stylesheet" type="text/css">
     <link href="/_layouts/styles/footer.css" rel="stylesheet" type="text/css">
     <link href="/_layouts/styles/dropmenu.css" rel="stylesheet" type="text/css">
     <script type="text/javascript" language="javascript" src="/_layouts/rollover.js"></script>
     <script type="text/javascript" language="javascript" src="/_layouts/topmenu.js"></script>
     <script type="text/javascript" language="javascript" src="/_layouts/footermenu.js"></script>
    </head>
    <body>
    <table width="100%" height="100%">
      
       <tr width="100%" height="10%">
        <td colspan="3">
         <script type="text/javascript"> Javascript: TOPBOX_MYINFY()</script>
        </td>
       </tr>
      
             <tr height="80%">
            
        <td width="15%" >
         <asp:ContentPlaceHolder ID="LeftNavigation" runat="server" />
              </td>
       
                 <td width="70%" height="100%">
         <asp:ContentPlaceHolder id="PlaceHolderMain" runat="server" />
                 </td>      
                
                 <td width="15%">
         <asp:ContentPlaceHolder ID="RightNavigation" runat="server" />
                 </td>
             </tr>
            
             <tr width="100%" height="10%">
        <td colspan="3">
         <script type="text/javascript"> Javascript: FOOTERBOX_MYUNIT_IS()</script>
        </td>
       </tr>
    </table>
    </body>
    </html>
     
     
    I have used the above master page file in following aspx page:
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <%@ Page language="C#" MasterPageFile="_catalogs/masterpage/IS.master" Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint,Version=14.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" meta:progid="SharePoint.WebPartPage.Document"  %>
    <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Import Namespace="Microsoft.SharePoint" %>
    <%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
    <asp:Button Text="Click" runat="server"></asp:Button>
    </asp:Content>
     
     
     
    Now, when I open the above master page in Internet Explorer, I get following error:
    An error occurred during the processing of /ISTeamSiteBlank/untitled_1.aspx. Only Content controls are allowed directly in a content page that contains Content controls.
     
    Kindly let me know whats going wron here.
     
    Regards,
    Sachin R. Chavan.

All Replies

  • Tuesday, December 07, 2010 9:26 AM
     
     Answered
    You need to move the XHTML doctype declaration into your master page (and delete it from your aspx page) - as the error message says, once you have an ASPX page using content controls you can't have anything other than content controls and ASPX declarations in it.
    MVP - Microsoft Office SharePoint Server