Mutliple/Duplicate web parts instances in the custom page layout for Publishing
-
2012年5月18日 13:53
Hi,
I am facing this issue of Mutliple/Duplicate web parts instances in the pages created from my custom page layout for Publishing . Code is below
<%@ Page language="C#" Inherits="Microsoft.SharePoint.Publishing.PublishingLayoutPage,Microsoft.SharePoint.Publishing,Version=14.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" meta:progid="SharePoint.WebPartPage.Document" %> <%@ Register Tagprefix="SharePointWebControls" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="PublishingWebControls" Namespace="Microsoft.SharePoint.Publishing.WebControls" Assembly="Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="PublishingNavigation" Namespace="Microsoft.SharePoint.Publishing.Navigation" Assembly="Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register tagprefix="WebPart1" Namespace="XXXXXX.YYYY.WebPart1" assembly="XXXXXX.YYYY, Version=1.0.0.0, Culture=neutral, PublicKeyToken=51c18be5544e2378" %> <%@ Register tagprefix="WebPart2" Namespace="XXXXXX.YYYY.WebPart2" assembly="XXXXXX.YYYY, Version=1.0.0.0, Culture=neutral, PublicKeyToken=51c18be5544e2378" %> <%@ Register tagprefix="WebPart3" Namespace="XXXXXX.YYYY.Webpart3" assembly="XXXXXX.YYYY, Version=1.0.0.0, Culture=neutral, PublicKeyToken=51c18be5544e2378" %> <asp:Content ContentPlaceholderID="PlaceHolderPageTitle" runat="server"> <SharePointWebControls:FieldValue id="PageTitle" FieldName="Title" runat="server"/> </asp:Content> <asp:Content ContentPlaceholderID="PlaceHolderMain" runat="server"> <WebPartPages:SPProxyWebPartManager runat="server" id="spproxywebpartmanager"></WebPartPages:SPProxyWebPartManager> <div id="stage"> <div Class="contents"> <div Class="articles"> <WebPartPages:WebPartZone runat="server" ID="topZone"> <ZoneTemplate> <WebPart1:WebPart1 runat="server" ID="g_53934471_9a5e_477e_ac25_51c27ce53ba8" Description="My Visual WebPart" ReportSiteUrl=http://ZZZZ.XXXXXX.com/sites/YYYY ChromeType="None" Title="Webpart1" WebPartId="{53934471-9A5E-477E-AC25-51C27CE53BA8}"></WebPart1:WebPart1> </ZoneTemplate> </WebPartPages:WebPartZone> </div> <div Class="footers"> <WebPartPages:WebPartZone runat="server" ID="BottomZone"> <ZoneTemplate> <WebPart2:WebPart2 runat="server" ID="g_e851e4f0_384a_4258_98e4_a319cc15cedd" Description="My WebPart" ChromeType="None" Title="My Webpart" WebPartId="{E851E4F0-384A-4258-98E4-A319CC15CEDD}"></WebPart2:WebPart2> </ZoneTemplate> </WebPartPages:WebPartZone> </div> </div> <div Class="aside"> <WebPartPages:WebPartZone runat="server" ID="RightZone"> <ZoneTemplate> <WebPart3:WebPart3 runat="server" Description="My WebPart" Title="My Title" WebPartId="{9eb76590-3c12-4d63-aefb-a559c065a601}" ChromeType="None" WebPart="true" id="g_9eb76590_3c12_4d63_aefb_a559c065a601"></WebPart3:WebPart3> </ZoneTemplate> </WebPartPages:WebPartZone> <!-- /.aside --> </div> </div> </asp:Content>Pallavi Sharma
すべての返信
-
2012年5月18日 14:58
Hello Pallavi,
Could you please let us know some more details about the problem? How multiple instances creating a problem to your page?
Thanks
ajit
-
2012年5月18日 15:01
When i try to create a page from this layout i get mutliple instances, sometimes duplicates of the webparts. reading more about it foudn that it is due to feature activation http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010general/thread/7b71806e-203c-407e-8e3c-22d3370e4a7f still looking for a way to fix it in framework 3.5. remove duplicate webparts from page layouts / pages using feature reciever.
Pallavi Sharma
- 編集済み Pallavi Sharma 2012年5月18日 15:02
-
2012年5月24日 5:54モデレータ
Hi,
Please try the solution in this blog:http://blog.mastykarz.nl/preventing-provisioning-duplicate-web-parts-instances-on-feature-reactivation/
In this article it presents some possible approaches to prevent it and make your Feature provision always only one instance of each Web Part.
Xue-mei Chang
TechNet Community Support
- 回答としてマーク Xue-Mei Chang-MSFTModerator 2012年5月27日 12:32

