Sharepoint: This page has been modified

by Martin 18. august 2009 12:40

I've implemented a solution for a customer, where we created a site definition template. In the onet.xml-file we defined some modules for default pages. Fairly easy. We created an aspx-page that resembled the layout page in the feature for the web-project. This means: we actually cerated the same markup twice, we even inherited from the same class! This seemed to work fine. It's noteworthy that the installation is running SP2. The problems started to occur a little later up the development cyclus, when our tester would perform normal content editing tests. When he edited a default page (only the one created by the module in the site def, not if you changed the default page to another) it would say that the page has been modified since it had been checked out. Weird was, that it didn't seem to be consistent when it did it or not. Sometimes editing and saving/publishing the page worked like a charm Yell I didn't take the time to look into the problem, so I just said it was a setup issue, and it would be a problem in the production environment later on. But it became a big problem!!

I read a lot of places, the your pages had to inherit from the TemplateRedirectionPage-class. Our class inherited from the PublishingPage-class so I tried to change the inheritance to the TemplateRedirectionPage. This did NOT do the trick! It blew up the page with more strange ASP.NET errors. Eventually I found out, it was only the aspx in the site def template dir (placed in C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\SiteTemplates) had to inherit from this class. but it didn't seem to help either; it still gave strange errors. At last I figured out, I had to remove ALL the markup from the aspx in the site def template dir! Then it would use my page layout in the web-feature instead! Just as defined in the onet.xml-module!

Example from onet.xml:

		<Module Name="DefaultCustomerPage" Url="$Resources:cmscore,List_Pages_UrlName;" Path="">
			<File Url="Default.aspx" Type="GhostableInLibrary" Path="CustomerSectionPage.aspx">
				<Property Name="Title" Value="$Resources:cmscore,IPPT_HomeWelcomePage_Title;" />
				<Property Name="MasterPageUrl" Value="~SiteCollection/_catalogs/masterpage/Customer.master" />
				<Property Name="PublishingPageLayout" Value="~SiteCollection/_catalogs/masterpage/CustomerSectionPage.aspx, Customer section page" />
				<Property Name="ContentType" Value="Customer section page" />
				<Property Name="PublishingAssociatedContentType"
Value=";#Customer section page;#0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF390095C37FB9ADBD44F59D2F0889858A3913;#" />
			</File>
		</Module>

Example from aspx:

<%@ Page Inherits="Microsoft.SharePoint.Publishing.TemplateRedirectionPage,Microsoft.SharePoint.Publishing,Version=12.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" %> <%@ Reference VirtualPath="~TemplatePageUrl" %> <%@ Reference VirtualPath="~masterurl/custom.master" %>

The example of the aspx has to be in ONE single line, two lines didn't work for me!

Tags: ,

.NET | MOSS

Tilføj kommentar

  Country flag

biuquote
  • Kommentar
  • Eksempel
Loading

Page List

About

Take a look at my LinkedIn-profile.

DISCALIMER: The content on this blog is in NO way affiliated with my employer. The opinions expressed on this blog are solely my own and in NO way endorsed by my employer.

Recent comments

Comment RSS

Month List