SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Following is the code in my page layout.

<WebPartPages:WebPartZone id="page_detail" runat="server" title="Page Detail" PartChromeType="None"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone>

Is it possible to add a default web part here so when the page loads, that web part is already there rather than user has to cick on "Add a web part" link?

I would like to add Content Editor web part here.

share|improve this question

Try to add this code to the page. This works for me in a master page but I didn't try in a page layout

<asp:WebPartManager ID="WebPartManager1" runat="server"/>
    <asp:WebPartZone ID="WebPartZone1" runat="server">
            <WebPartPages:ContentEditorWebPart ID="ContentEditorWebPart1" runat="server" __MarkupType="xmlmarkup" WebPart="true" __WebPartId="{put your guid here}" >
               <WebPart xmlns:xsi="" xmlns:xsd="" xmlns="">
                  <Title>Content Editor</Title>
          <Description>Allows authors to enter rich text content.</Description>
          <DetailLink />
          <HelpLink />
          <PartImageSmall />
          <MissingAssembly>Cannot import this Web Part.</MissingAssembly>
          <IsIncludedFilter />
          <Assembly>Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
          <ContentLink xmlns="" />
          <Content xmlns="">PUT YOUR CONTENT HERE</Content>
          <PartStorage xmlns="" />

Good Luck

share|improve this answer
Not working in page layout. It is showing error "The control type 'System.Web.UI.WebControls.WebParts.WebPartManager' is not allowed on this page." – Frank Martin Aug 5 '13 at 6:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.