Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Not possible to update existing page layouts included in a feature

  Asked By: Roxana    Date: May 14    Category: Sharepoint    Views: 4851

We are creating a publishing site and are planning on deploying our master pages and page layouts through features. We’ve created a feature with a content type, a master page and a page layout (aspx), installed it and activated it on a site collection. That worked fine.

However, since we are doing changes/additions to the master page and page layout during the development phase, we want to reinstall the feature to deploy our changes. Any changes to the master page works fine to deploy just by reinstalling the feature with the –force parameter. However, we can’t get any changes to the aspx file to get through. We have tried to install / uninstall the feature and also activated/inactivated it. We have also done iisreset several times. Whatever we try to do, the page new updated layout doesn’t seem to be applied to the pages we already created.

The strange thing is that when we create a new site collection and activate the reinstalled feature, the change is included! But we can’t get the site that was created before the reinstall to be updated with the new page layout.

Does anyone have any clues on what might be happening here? It must be possible to deploy and update existing page layouts through features, right?



1 Answer Found

Answer #1    Answered By: Deven Gajjar     Answered On: May 14

I had the same issue, and it took me about a month to figure out the solution. You can find a post about it here:

Basically, I created  my page  layout in SharePoint Designer, and then copied and pasted it into Visual Studio. When I deployed the page, though, it was behaving like you've explained, like it was customized. I finally checked the page using the SharePoint API and it was indeed registering as customized. This totally baffeled me, because SharePoint thought that page had been customized, even though the feature  had just been activated and it had been no where near SharePoint since I had activated the feature that deployed the files to the Site Collection Master Page Gallery.

It turns out the culpurit was this: SharePoint Designer put these two tags in the Page Directive at the top of the page:
meta:webpartpageexpansion="full" meta:progid="SharePoint.WebPartPage.Document"
when I originally created the page in SharePoint Deisgner. For whatever reason, when a Page layout  gets loaded and it sees these directives, it logs that page as being customized. So, when I copied my markup from SharePoint into the Page Layout in Visual Studio, it took these meta tags with it, and when I activated my feature, SharePoint said, "Aha, these pages  have been in SharePoint Designer" (which they were, originally, just not since I had deployed the feature), "... they must have been modified!"

I'm not sure if this is the issue you're having, but it certainly tripped me up for a while