Monday, March 10, 2008

This Page has been modified since you opened it. You must open the page again

You get the error, when you place custom .aspx pages in the "Pages" Doc Library of a publishing site.
MOSS Publishing feature has special meaning for "Pages" doc lib. If you intend to change it from the out of the box by writting a code in the .aspx pages in the "Pages" doc lib. Even if you place a simple Content Editor Webpart, it tries to change the "Microsoft.SharePoint.Publishing.PublishingLayoutPage" name space to "Microsoft.SharePoint.Publishing.PublishingLayoutPage". The error message says this change in a brief!

To avoid this, follow the workarounds specified below.
If you are confused or naive to Sharepoint Designer, simply copy the .aspx custom developed pages from the "Pages" doc lib to the area directly under the site folder. Good Luck!

While trying to edit the pages created in the publishing sites, you get this error.
When you use publishing in Sharepoint, you have a pages library with pages that have a page layout. These page layouts need to inherit from Microsoft.SharePoint.Publishing.PublishingLayoutPage and not from Microsoft.Sharepoint.Pages.WebpartPages.
You need to insert the pages in the pages library with a Page Layout.

The generic ONET.XML looks like this:

" Module Path="" Url="$Resources:cmscore,List_Pages_UrlName;" Name="DefaultBlank
File Url="default.aspx" Level="Approved" Type="GhostableInLibrary
Property Name="Title" Value="Default
Property Name="ContentType" Value="$Resources:cmscore,contenttype
"

You have to add a property to the page you are adding. That property is called ‘PublishingPageLayout’ and should have the page layout you want to use as the value.
The page layout that you want to use should inherit from Microsoft.SharePoint.Publishing.PublishingLayoutPage, and most reside in the masterpages gallery of your site collection.

ONET.XML, after modifying:

"
Module Path="" Url="$Resources:cmscore,List_Pages_UrlName;" Name="DefaultBlank
File Url="default.aspx" Level="Approved" Type="GhostableInLibrary

Property Name="PublishingPageLayout" Value="~SiteCollection/_catalogs/masterpage/WelcomeLinks.aspx, ~SiteCollection/_catalogs/masterpage/Contact.aspx
Property Name="ContentType" Value="$Resources:cmscore,contenttype_pagelayout_name;">


"

If you have the page display problem after installing SP1, follow the instructions below:

Replace

Page language="C#" Inherits="Microsoft.SharePoint.Publishing.PublishingLayoutPage, Microsoft.SharePoint.Publishing,Version=12.0.0.0, Culture=neutral,PublicKeyToken=71e9bce111e9429c" metarogid="SharePoint.WebPartPage.Document" meta:webpartpageexpansion="full"
with

Page language="C#" Inherits="Microsoft.SharePoint.Publishing.TemplateRedirectionPage, Microsoft.SharePoint.Publishing, Version=12.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" metarogid="SharePoint.WebPartPage.Document" meta:webpartpageexpansion="full"






No comments:

Post a Comment