Welcome to Comunidade Bloggers |create|it| Sign in | Join | Help

Raúl Ribeiro

Windows SharePoint Services 3.0 , .net, Microsoft Office SharePoint 2007, Office 2007 and 2010

News

Duplicated WebPart added to a Page on WCM

For some reason, when using features to add pages to a WCM site the webparts that exist on the page appear duplicated.

But using API and getting the object weparts using the GetLimitedWebPartManager there is only the correct webpart.

Then when i was trying to find the reason for this problem, the SharePoint Designer gave me the solution.

He automatically added to the <%@ Page this information meta:webpartpageexpansion="full".

So i've changed the page on my feature, deleted the page from my site, deactivate the feature, activate the feature and voiala my page is working.

By the way i've used a feature to add pages to my site because the page will exist on every sites and subsites of my site.

CHANGED: Don't use this option, please see the comment to this post

Posted: Friday, January 18, 2008 11:47 AM by admin
Filed under:

Comments

Scoutman said:

Hi there!

The "meta:webpartpageexpansion="full" " is an Inheritance back-compatibility of Sharepoint 2003. Putting that on the page will customize it , and in a  import/export scenarios the page soon or later will lose is "ghosted" property., leaving the page  with stange behaviors (eggxample:trying to reset to site definition of that page Moss says " This page is not part of a solutions , therefore you cannot make a reset to site definition"

The Real Solution:

Use AllUserWebParts in the elements file of a feature and create a Feature Receiver to delete all in Deactiving event .

It Rocks, real good!

# March 27, 2008 7:47 PM
Anonymous comments are disabled