Skip to main content

SharePoint PageLayout MissingMethodException and ErrorWebPart

PART 1 (FIX IN PART 2):

Another SharePoint boggling issue. I defined a Page Layout as illustrated below. It has two columns left and right with 80% and 20% width respectively. When deploying this page on my local system I found that creating a page resulted in an error. Entering web part maintenance mode on the pagelayout page revealed there were several ErrorWebPart components listed for my page layout? At the moment I do not have time to investigate why or how they are there. But removing these through the maintenance protal fixed the defect. If I get around to tracing the source of the issue I will post. Hopefully the latest cumulative update will prevent this sort of defect from occuring!


 <%@ Page ClassName="BOQTwoColumnPageLayout" AutoEventWireup="true"  language="C#"   Inherits="Microsoft.SharePoint.Publishing.PublishingLayoutPage,Microsoft.SharePoint.Publishing,Version=14.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="SharePointWebControls" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, 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" %>
<%@ Register Tagprefix="PublishingWebControls" Namespace="Microsoft.SharePoint.Publishing.WebControls" Assembly="Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="PublishingNavigation" Namespace="Microsoft.SharePoint.Publishing.Navigation" Assembly="Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<asp:Content ID="Content1" ContentPlaceHolderId="PlaceHolderPageTitle" runat="server">
 <SharePoint:ProjectProperty ID="ProjectProperty1" Property="Title" runat="server"/>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderId="PlaceHolderMain" runat="server">
 <table cellspacing="0" border="0" width="100%">
   <tr class="s4-die">
    <td class="ms-pagebreadcrumb">
    <asp:SiteMapPath SiteMapProvider="SPContentMapProvider" id="ContentMap" SkipLinkText="" NodeStyle-CssClass="ms-sitemapdirectional" runat="server"/>
    </td>
   </tr>
   <tr>
  <td>
   <table width="100%" cellpadding="0" cellspacing="0" style="padding: 5px 10px 10px 10px;">
    <tr>
     <td valign="top" width="80%">
      <WebPartPages:WebPartZone runat="server" FrameType="TitleBarOnly" ID="Left" Title="loc:Left" >
      </WebPartPages:webpartzone>&#160;
     </td>
     <td>&#160;</td>
     <td valign="top" width="20%">
      <WebPartPages:WebPartZone runat="server" FrameType="TitleBarOnly" ID="Right" Title="loc:Right" >
      </WebPartPages:webpartzone>&#160;
     </td>
     <td>&#160;</td>
    </tr>
   </table>
  </td>
   </tr>
 </table>
</asp:Content>


PART 2 (INCLUDES FIX):


Turns out that the source of the error was in my definition of the Page Layout, which was creating 3 ErrorWebPart's. I had a second Content panel for the breadcrumb which I simply removed to resolve one ErrorWebPart. The other is that my web part zones didn't have a zonetemplate. Adding an empty "ZoneTemplate" to the left and right web part zones resolved the remaining 2 ErrorWebPart's. I have also copy-pasted my Elements.xml just in case for others to use =D.


PageLayout.aspx

 <%@ Page ClassName="BOQTwoColumnPageLayout" language="C#"   Inherits="Microsoft.SharePoint.Publishing.PublishingLayoutPage,Microsoft.SharePoint.Publishing,Version=14.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" meta:webpartpageexpansion="full" meta:progid="SharePoint.WebPartPage.Document" %>
<%@ Register Tagprefix="SharePointWebControls" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, 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" %>
<%@ Register Tagprefix="PublishingWebControls" Namespace="Microsoft.SharePoint.Publishing.WebControls" Assembly="Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="PublishingNavigation" Namespace="Microsoft.SharePoint.Publishing.Navigation" Assembly="Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<asp:Content ID="Content" ContentPlaceHolderId="PlaceHolderMain" runat="server">
 <table cellspacing="0" border="0" width="100%">
   <tr>
  <td>
   <table width="100%" cellpadding="0" cellspacing="0" style="padding: 5px 10px 10px 10px;">
    <tr>
     <td valign="top" width="80%">
      <WebPartPages:WebPartZone runat="server" FrameType="TitleBarOnly" ID="Left" Title="loc:Left" >
      <ZoneTemplate></ZoneTemplate>
      </WebPartPages:webpartzone>
     </td>
     <td valign="top" width="20%">
      <WebPartPages:WebPartZone runat="server" FrameType="TitleBarOnly" ID="Right" Title="loc:Right" >
      <ZoneTemplate></ZoneTemplate>
      </WebPartPages:webpartzone>
     </td>
    </tr>
   </table>
  </td>
   </tr>
 </table>
</asp:Content>

ELEMENTS.XML


<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/ ">
  <Module Name="PageLayout" Url="_catalogs/masterpage">
  <File Path="PageLayout\BOQTwoColumnLayout.aspx" Url="BOQTwoColumnLayout.aspx" Type="GhostableInLibrary">
    <Property Name="Title" Value="BOQ TwoColumn Layout" />
    <Property Name="ContentType" Value="$Resources:cmscore,contenttype_pagelayout_name;" />
    <Property Name="PublishingPreviewImage" Value="~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/CustomPageLayout.png, ~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/CustomPageLayout.png" />
  </File>
</Module>
</Elements> 

Comments

Popular posts from this blog

WinDBG on 32Bit Applications

EXCEL Macro - Compare Column A to Column B

Powershell Script to Automatically Deploy Sharepoint WSP Packages