Ads

Thursday, 14 July 2016

Add web part zone in master page to add webpart


In master page, there is a content place holder:  
<asp:ContentPlaceHolder id="PlaceHolderLeftActions " runat="server">
</asp:ContentPlaceHolder>


So if you place the SAME ID for my web part zone in the Page layout/Page, at run time, The Master Page's content on PlaceHolderLeftActions will be replaced by the content page

In simple steps:
1. Create a Blank .Aspx page with SPD
2. Just insert the code as per the below screenshot

<asp:ContentPlaceHolder id="PlaceHolderLeftActions " runat="server"></asp:ContentPlaceHolder>



Note:
Same way, If you want to insert a webpart in Master page, you can use the same Technique, insert your own Tag in Master page and replace the content in your content page by assigning same tag.
<asp:ContentPlaceHolder id="MyTag" runat="server"></asp:ContentPlaceHolder>



No comments:

Post a Comment

Ads