SharePoint - Delegate Control
Zadáni
Potřebuji vložit do SharePoint 2010/2013 master page stránky kus kódu.
Řešení
Lze to provést pomocí vytvořeného prvku typu delegate control.
Postup
Založim Empty Element
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="https://schemas.microsoft.com/sharepoint/">
<Control Sequence="1000" ControlSrc="~/_controltemplates/RegisterUser.ascx" />
</Elements>
Založím Visual Webpart - RegisterUser.ascx
<div runat="server">
<a href="#">Testovací Delegate Control</a>
</div>
Upravím master page pomocí SharePoint Designeru (vložim kód)
<SharePoint:DelegateControl ControlId="mujRegisterControl" AllowMultipleControls="true" runat="server"></SharePoint:DelegateControl>
Odkazy
- Create delegate control in sharepoint
https://mihirsharepoint.wordpress.com/2012/11/15/create-delegate-control-in-sharepoint/ Using Delegate Control in Sharepoint
https://www.codeproject.com/Articles/569897/UsingplusDelegateplusControlplusinplusSharepoint- Add,Remove Links in Top Suitebar (SkyDrive,Sites,NewsFeed) in SharePoint 2013
https://www.learningsharepoint.com/2013/02/10/addremove-links-in-top-suitebar-skydrivesitesnewsfeed-in-sharepoint-2013/
