-We want to redirect the user to a site if the user is in a subsite
Procedure :
Add a UserControl in your SharePoint Visual Studio project
- Create a new element in visual studio, it will create files in ControlTemplates
Deploy the project
Go to "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\CONTROLTEMPLATES" in order to see the full link of your userControl that you are gonna use in the next step
Reference your UserControl in the masterPage thanks to, and adapt the link :
1: <%@ Register Src="~/_controltemplates/yourprojectName/Logos.ascx" TagName="Logos" TagPrefix="uc1" %>
Reference the userControl in the masterPAge :
1: <uc1:Logos id="Logos1" runat="server"> </uc1:Logos >
Code the user control thanks to the .cs
How to debug a user control :
It's possible to debug the user control, by attaching all Sharepoint Processus (see CKSDev Extension for visual studio)
2 commentaires:
@
i am getting unknown server tag error. i have followed same steps.
Hello, could you post the code you are using ?
Regards,
Jeff ANGAMA
Enregistrer un commentaire