title: SharePoint 2007: Publishing Error from Page based on Custom Masterpage
body: <p>I've developed a base SharePoint master page based on <a href="http://www.heathersolomon.com/blog/archive/2007/01/26/6153.aspx" rel="nofollow">Heather's</a>. below is the based page that I've customized.</p>
  
  <pre><code>&lt;%-- Identifies this page as a .master page written in Microsoft Visual C# and registers tag prefixes, namespaces, assemblies, and controls. --%&gt;
  &lt;%@ Master language="C#" %&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;%@ Import Namespace="Microsoft.SharePoint" %&gt;
  &lt;%@ Register Tagprefix="SPSWC" Namespace="Microsoft.SharePoint.Portal.WebControls" Assembly="Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %&gt;
  &lt;%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %&gt;
  &lt;%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %&gt;
  &lt;%@ Register Tagprefix="PublishingWebControls" Namespace="Microsoft.SharePoint.Publishing.WebControls" Assembly="Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %&gt;
  &lt;%@ Register Tagprefix="PublishingNavigation" Namespace="Microsoft.SharePoint.Publishing.Navigation" Assembly="Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %&gt;
  &lt;%@ Register TagPrefix="wssuc" TagName="Welcome" src="~/_controltemplates/Welcome.ascx" %&gt;
  &lt;%@ Register TagPrefix="wssuc" TagName="DesignModeConsole" src="~/_controltemplates/DesignModeConsole.ascx" %&gt;
  &lt;%@ Register TagPrefix="PublishingVariations" TagName="VariationsLabelMenu" src="~/_controltemplates/VariationsLabelMenu.ascx" %&gt;
  &lt;%@ Register Tagprefix="PublishingConsole" TagName="Console" src="~/_controltemplates/PublishingConsole.ascx" %&gt;
  &lt;%@ Register TagPrefix="PublishingSiteAction" TagName="SiteActionMenu" src="~/_controltemplates/PublishingActionMenu.ascx" %&gt;
  &lt;%-- Uses the Microsoft Office namespace and schema. --%&gt;
  &lt;html&gt;
    &lt;WebPartPages:SPWebPartManager runat="server"/&gt;
    &lt;SharePoint:RobotsMetaTag runat="server"/&gt;
  
    &lt;%-- The head section includes a content placeholder for the page title and links to CSS and ECMAScript (JScript, JavaScript) files that run on the server. --%&gt;
    &lt;head runat="server"&gt;
      &lt;asp:ContentPlaceHolder runat="server" id="head"&gt;
          &lt;title&gt;
          &lt;asp:ContentPlaceHolder id="PlaceHolderPageTitle" runat="server" /&gt;
        &lt;/title&gt;
      &lt;/asp:ContentPlaceHolder&gt;
      &lt;Sharepoint:CssLink runat="server"/&gt;
      &lt;asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server" /&gt;
    &lt;/head&gt;
  
    &lt;%-- When loading the body of the .master page, SharePoint Server 2007 also loads the SpBodyOnLoadWrapper class. This class handles .js calls for the master page. --%&gt;
    &lt;body onload="javascript:_spBodyOnLoadWrapper();"&gt;
      &lt;%-- The SPWebPartManager manages all of the Web part controls, functionality, and events that occur on a Web page. --%&gt;
      &lt;form runat="server" onsubmit="return _spFormOnSubmitWrapper();"&gt;
        &lt;wssuc:Welcome id="explitLogout" runat="server"/&gt;
        &lt;PublishingSiteAction:SiteActionMenu runat="server"/&gt;  
        &lt;PublishingWebControls:AuthoringContainer id="authoringcontrols" runat="server"&gt;
          &lt;PublishingConsole:Console runat="server" /&gt;
        &lt;/PublishingWebControls:AuthoringContainer&gt;
        &lt;%-- The PlaceHolderMain content placeholder defines where to place the page content for all the content from the page layout. The page layout can overwrite any content placeholder from the master page. Example: The PlaceHolderLeftNavBar can overwrite the left navigation bar. --%&gt;
        &lt;asp:ContentPlaceHolder id="PlaceHolderMain" runat="server" /&gt;
          &lt;asp:Panel visible="false" runat="server"&gt;
          &lt;%-- These ContentPlaceHolders ensure all default SharePoint Server pages render with this master page. If the system master page is set to any default master page, the only content placeholders required are those that are overridden by your page layouts. --%&gt;&lt;asp:ContentPlaceHolder id="PlaceHolderSearchArea" runat="server"/&gt;&lt;asp:ContentPlaceHolder id="PlaceHolderTitleBreadcrumb" runat="server"/&gt;&lt;asp:ContentPlaceHolder id="PlaceHolderPageTitleInTitleArea"  runat="server"/&gt;&lt;asp:ContentPlaceHolder id="PlaceHolderLeftNavBar" runat="server"/&gt;&lt;asp:ContentPlaceHolder ID="PlaceHolderPageImage" runat="server"/&gt;&lt;asp:ContentPlaceHolder ID="PlaceHolderBodyLeftBorder" runat="server"/&gt;&lt;asp:ContentPlaceHolder ID="PlaceHolderNavSpacer" runat="server"/&gt;&lt;asp:ContentPlaceHolder ID="PlaceHolderTitleLeftBorder" runat="server"/&gt;&lt;asp:ContentPlaceHolder ID="PlaceHolderTitleAreaSeparator" runat="server"/&gt;&lt;asp:ContentPlaceHolder ID="PlaceHolderMiniConsole" runat="server"/&gt;&lt;asp:ContentPlaceHolder id="PlaceHolderCalendarNavigator" runat ="server" /&gt;&lt;asp:ContentPlaceHolder id="PlaceHolderLeftActions" runat ="server"/&gt;&lt;asp:ContentPlaceHolder id="PlaceHolderPageDescription" runat ="server"/&gt;&lt;asp:ContentPlaceHolder id="PlaceHolderBodyAreaClass" runat ="server"/&gt;&lt;asp:ContentPlaceHolder id="PlaceHolderTitleAreaClass" runat ="server"/&gt;&lt;asp:ContentPlaceHolder id="PlaceHolderBodyRightMargin" runat="server" /&gt;&lt;/asp:Panel&gt;
      &lt;/form&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I also created a SharePoint content page that contains Web Part Zone so that pages based on the said master page will have one web part zone. However, after saving the content, I got the following error:</p>
  
  <blockquote>
    <p>This Page has been modified since you opened it. You must open the
    page again.</p>
    
    <p>Refresh page.  Troubleshoot issues with Windows SharePoint Services.</p>
  </blockquote>
  
  <p>I'm not sure if I missed any SharePoint control to prevent the said error.</p>
  
  <p><strong>Update</strong></p>
  
  <p>I added the following script after the <code>&lt;/body&gt;</code> tag and the issue did not appeared again, so far.  </p>
  
  <pre><code>&lt;script language="javascript" type="text/javascript"&gt;
      (function(){
          var MSO_PageHashCode = document.getElementById('MSO_PageHashCode');
          if(MSO_PageHashCode) {
              MSO_PageHashCode.value = '';
          }
      })();   
  &lt;/script&gt;
  </code></pre>