Bojensen Blogs

Add Webpart zone on Masterpage in SharePoint « All About SharePoint

You know you can’t add a webpart zone into Master page directly, but there is tricky you can do it.

Just add

<asp:ContentPlaceHolder id=”WeatherPart” runat=”server”></asp:ContentPlaceHolder>

In the pagelayouts, set a control with the same id-name and place your webpartzone inside. You have to do this for every pagelayout that needs a header image in the masterpage. For each page though, there has to be added a image webpart, or whatever webpart you like. So be aware of this, if you use a webpartzone in your masterpage.

<asp:Content ContentPlaceHolderId=”WeatherPart” runat=”server”>
<div>
<WebPartPages:WebPartZone runat=”server” Title=”WeatherPart” ID=”WeatherPart”><ZoneTemplate></ZoneTemplate>
</WebPartPages:WebPartZone>
</div>
</asp:Content>

Add Webpart zone on Masterpage in SharePoint « All About SharePoint

Comments are closed.