Add UserControl in Sharepoint Masterpage


1) create empty sharepoint project.
2) create sharepoint controltemplte mapped folder.
3) In Control templates create usercontrol and deploy the solution.
4) the user control .ascx will deployed at this location.
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\CONTROLTEMPLATES
5) Add this tag in top of sharepoint master page.
<%@ Register TagPrefix="CustomNews" TagName="CurrentPageControl" Src="~/_controltemplates/UserControl.ascx" %>
6) use this tag in where you want to display usercontrol data.

 <CustomNews:CurrentPageControl ID="myControl" runat="server"/>

Comments

Popular posts from this blog

WCF interview questions

The term 'Connect-MsolService' is not recognized as the name of a cmdlet, function, script file, or operable program

what is Event Cache table in sharepoint