Question

I'm kind of stuck adding a web part to the Person.aspx page....I have a custom web part which I have uploaded but I'm not sure how to add it.

On the masterpage (in SharePoint Designer) I went to Insert->Web Part-> and insterted my web part.

Now in the Person.aspx I copied and pasted this code under one of the web part zones, right now its sitting just as a duplicate of the AskMeAboutWebPart:

<SPSWC:AskMeAboutWebPart runat="server" __MarkupType="xmlmarkup" WebPart="true" __WebPartId="{EAC6834A-8E73-4D1B-B7BE-193CBDB09F30}" >
<WebPart xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/WebPart/v2">
  <Title>My Custom Web Part</Title>
  <FrameType>TitleBarOnly</FrameType>
  <Description>The web part that shows custom things.</Description>
  <IsIncluded>true</IsIncluded>
  <ZoneID>MiddleLeftZone</ZoneID>
  <PartOrder>2</PartOrder>
  <FrameState>Normal</FrameState>
  <Height />
  <Width />
  <AllowRemove>true</AllowRemove>
  <AllowZoneChange>true</AllowZoneChange>
  <AllowMinimize>true</AllowMinimize>
  <AllowConnect>true</AllowConnect>
  <AllowEdit>true</AllowEdit>
  <AllowHide>true</AllowHide>
  <IsVisible>true</IsVisible>
  <DetailLink />
  <HelpLink />
  <HelpMode>Modeless</HelpMode>
  <Dir>Default</Dir>
  <PartImageSmall />
  <MissingAssembly>Cannot import this Web Part.</MissingAssembly>
  <PartImageLarge />
  <IsIncludedFilter />
  <ExportControlledProperties>true</ExportControlledProperties>
  <ConnectionID>00000000-0000-0000-0000-000000000000</ConnectionID>
  <ID>g_eac6834a_8e73_4d1b_b7be_193cbdb09f30</ID>
</WebPart>
</SPSWC:AskMeAboutWebPart>

Now what do I need to change in this section of code to add my web part? Basically I think I need to change the , the name, and the WebPartId but I'm not sure where to find these things, well other than the name. Where can I find the WebPartId and ??? Would this work for what I'm trying to accomplish?

Thanks you for any assistance

Was it helpful?

Solution

Why dont you add it programmatically, then save master page as a template never done it myself but worth a go.

for adding it to the page programmatically all you need is webpart's dll and here's the tutorial for it

Add-Web-Part-to-Page-Programmatically.

or try SharePoint Designer

enter link description here

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top