5

I have made a publishing page layout that has a WebPartZone and a MediaWebPart in the ZoneTemplate. Example below.

<WebPartPages:WebPartZone runat="server" Title="Fokusøki Media" ID="WebPartZone1" AllowLayoutChange="true" AllowPersonalization="false">
  <ZoneTemplate>
    <PublishingWebControls:MediaWebPart ID="mediaWebPart1" AutoPlay="true" AllowEdit="true" AllowClose="true" Title="MediaWebPart" runat="server" />
  </ZoneTemplate>
</WebPartPages:WebPartZone>

The WebPart show just fine on the page, and works like supposed. But when i click "Save and Close" or "Publish" on the ribbon, I get the following error message.

The operation could not be completed because the Web Part is not on this page. Stack Trace:

[WebPartPageUserException: The operation could not be completed because the Web Part is not on this page.]
   Microsoft.SharePoint.WebPartPages.SPWebPartManager.ThrowIfNotOnPage(WebPart webPart) +27111847
   Microsoft.SharePoint.WebPartPages.SPWebPartManager.GetStorageKey(WebPart webPart) +30
   Microsoft.SharePoint.Publishing.WebControls.MediaWebPart.UpdateWebPartProperties() +380
   Microsoft.SharePoint.Publishing.WebControls.MediaWebPart.OnLoad(EventArgs e) +49
   System.Web.UI.Control.LoadRecursive() +66
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Control.LoadRecursive() +191
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428
2
  • Is your publishing infrastructure enabled? Did you check out the page before editing?
    – Mike
    Nov 13, 2012 at 22:22
  • @Mike. Yes it is enabled and yes, the page was checked out.
    – Oddmar Dam
    Nov 13, 2012 at 23:30

1 Answer 1

0

Try adding the web part to the page layout using as mentioned here: link

1
  • Do not put just links.. Links might go down. And not all people have access to links. So try putting some important part of the answer here and keep link for reference.. Thanks
    – Gaurravs
    May 23, 2016 at 4:37

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.