3

I try to add a webpart zone to a page layout in SharePoint Online.

I added this code:

<!--MS:<asp:ContentPlaceHolder id="Content1" runat="Server">-->
    <!--MS:<WebPartPages:WebPartZone runat="server" AllowPersonalization="true" ID="WebPartZone2" FrameType="TitleBarOnly" Title="Bottom" Orientation="Vertical">-->
        <!--MS: <ZoneTemplate>-->
            <!--MS:<WebPartPages:ClientWebPart runat="server"
                FeatureId="e8a884cf-f7d3-44ab-be09-5e5595171495"
                ProductWebId="32d215ce-7a60-4812-b847-ef52de360cab"
                WebPartName="Name"
                Title="Project"
                Description="WebPart Description"
                WebPart="true">-->
            <!--ME:</WebPartPages:ClientWebPart>-->
        <!--ME:</ZoneTemplate>-->
    <!--ME:</WebPartPages:WebPartZone>-->
<!--ME:</asp:ContentPlaceHolder>-->

If I open the modified page I get this error: "Unknown server tag 'WebPartPages:WebPartZone".

On the top of my file I have this reference but it does not work:

<!--SPM:<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>-->
  • It seems you are using a snippet for the assembly for the 2010 version of SharePoint, replace 14.0 with 15.0 – Robert Lindgren May 27 '15 at 9:25
  • Changed the version number in my reference, but I get the same error – Philipp Eger May 27 '15 at 9:34
4

The same issue occurred at my end when I placed the assembly reference in the page directives (top of the page layout). Namespace was as below:

<!--SPM:<%@Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>-->

So I simply added this namespace before the webpart zone and removed from top of the page. This looks weird but it worked.

<!--CS: Start Web Part Zone Snippet-->
    <!--SPM:<%@Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>-->
    <div xmlns:ie="ie">
        <!--MS:<WebPartPages:WebPartZone runat="server" AllowPersonalization="false" ID="x3156ba02c8c5468e88797eb78c36089f" FrameType="TitleBarOnly" Orientation="Vertical">-->
           <!--MS:<ZoneTemplate>-->
               <!-- Your Custom Client WebPart Code Goes Here -->
           <!--ME:</ZoneTemplate>-->
        <!--ME:</WebPartPages:WebPartZone>-->
    </div>
<!--CE: End Web Part Zone Snippet-->
  • 1
    Thank you for your help. This is really weird and I have no idea why, but it works! :-) – Philipp Eger May 27 '15 at 12:30
-1

Make sure you have all the following tags added at the top of your page layout.

<%@ Page Language="C#" Inherits="Microsoft.SharePoint.Publishing.PublishingLayoutPage, Microsoft.SharePoint.Publishing, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" meta:progid="SharePoint.WebPartPage.Document" meta:webpartpageexpansion="full" %>

<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Publishing" Namespace="Microsoft.SharePoint.Publishing.WebControls" Assembly="Microsoft.SharePoint.Publishing, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

Above first webpart zone added in your pagelayout <WebPartPages:WebPartZone make sure you have <WebPartPages:SPProxyWebPartManager runat="server" id="spproxywebpartmanager1"></WebPartPages:SPProxyWebPartManager> added

Let me know if you have any questions

  • I added the references to the top of the page layout and added the <WebPartPages:SPProxyWebPartManager>-tag but now I get this error message: "Unknown server tag 'WebPartPages:SPProxyWebPartManager'". – Philipp Eger May 27 '15 at 11:45
  • Can you share the code of your entire page layout? and also mention which version of sharepoint are you using. – Naveen May 27 '15 at 12:05
  • I am using SharePoint Online. Sorry, but it's a customized page from a customer and unfortunately I am not allowed to share the code. – Philipp Eger May 27 '15 at 12:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.