Implement Custom SuiteLinks Delegate Control in SharePoint 2013

sharepoint 2013 custom SuiteLinks Delegate Control.png
SharePoint deveopment training course

This SharePoint 2013 tutorial, we will discuss, how to implement SuiteLinks Delegate Control in SharePoint 2013.

To implement Custom SuiteLinks Delegate Control in SharePoint 2013, we will use visual studio 2013.

SuiteLinksDelegate in SharePoint 2013

SuiteLinksDelegate: is a new delegate control introduced in SharePoint 2013. If you are looking to add a new link just next to “Sites, NewsFeed, SkyDrive” etc. on the top bar of your SharePoint site. You can now do that with a new delegate control “SuiteLinksDelegate”. The SuiteLinksDelegate control will allow us to modify the default links.

For Example: To add our own links, in the “suit links”
Header before:

Custom SuiteLinks Delegate Control in SharePoint
Custom SuiteLinks Delegate Control in SharePoint

Implement Custom SuiteLinks Delegate Control in SharePoint 2013

Follow below steps to Implement Custom SuiteLinks Delegate Control in SharePoint 2013.

Step-1:
Create One Empty SharePoint Project and Provide the Solution Name and Choose the Solution Path and Click on OK.

Step-2:
Deploy the Solution as Farm Solution. Provide the Url in the next Screen and validate the Connection.

Step-3:
Add New UserControl to the Project from the Templates and Provide the Name to it, in our case it is “MyCustomSuiteLinksDelegate”.

sharepoint 2013 custom SuiteLinks Delegate Control
sharepoint 2013 custom SuiteLinks Delegate Control

Now Our Solution Explorer looks as follows,

sharepoint 2013 custom SuiteLinks Delegate Control
sharepoint 2013 custom SuiteLinks Delegate Control

Step-4:
Add a reference to Microsoft.SharePoint.Portal dll.

Implement Custom SuiteLinks Delegate Control in SharePoint 2013
Implement Custom SuiteLinks Delegate Control in SharePoint 2013

Step-5:
Code snippet for the ascx.cs file

using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Utilities;
using Microsoft.SharePoint.WebControls;
using System.Globalization;
using System.IO;
using System.Collections;
using Microsoft.SharePoint.Portal;
using Microsoft.SharePoint.Portal.WebControls;

namespace SuiteBarBrandingDelegate_Example.ControlTemplates.SuiteLinksDelegate_Example
{
public partial class MyCustomSuiteLinksDelegate : UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
}

protected override void Render(HtmlTextWriter writer)
{
writer.RenderBeginTag(HtmlTextWriterTag.Style);
writer.Write(".ms-core-suiteLinkList {display: inline-block;}");
writer.RenderEndTag();
writer.AddAttribute(HtmlTextWriterAttribute.Class, "ms-core-suiteLinkList");
writer.RenderBeginTag(HtmlTextWriterTag.Ul);
RenderSuiteLink(writer, "http://AboutUs/", "About Us", "lnkSearchLink", false);
RenderSuiteLink(writer, "http://ContactUs/", "Contact Us", "lnkSearchLink", false);
RenderSuiteLink(writer, "http://Feedback", "Requisition Manager", "lnkSearchLink", false);
writer.RenderEndTag();
base.Render(writer);
}
}
}

Step-6:
Add Elements.xml file to the Solution, Provide the name and click on Add.

Custom SuiteLinks Delegate Control in SharePoint 2013
Custom SuiteLinks Delegate Control in SharePoint 2013

Step-7:
Click on elements.xml file paste the below code snippet inside the elements tag.

<?xml version="1.0″ encoding="utf-8″?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!– Adding DelegateControl reference to our custom SuiteSuiteLinksDelegate Control –>
<Control ControlSrc="/_controltemplates/15/SuiteLinksDelegate_Example\MyCustomSuiteSuiteLinksDelegate.ascx"
Id="SuiteLinksDelegate" Sequence="90″ />
</Elements>

Step-8:
The final step is to build and deploy then, the SharePoint text will be overridden with the Text of the portal.

The final Outcome will be look as follows:

custom SuiteLinks Delegate Control sharepoint 2013 visual studio
custom SuiteLinks Delegate Control sharepoint 2013 visual studio

You may like following SharePoint 2013 visual studio tutorials:

Hope this SharePoint 2013 tutorial explains, steps to implement Custom SuiteLinks Delegate Control in SharePoint 2013.

Check out Best Alternative to InfoPath -> Try Now

free sharepoint training

SharePoint Online FREE Training

JOIN a FREE SharePoint Video Course (3 Part Video Series)

envelope
envelope

About Sagar Pardeshi

I am Developer working on Microsoft Technologies for the past 6+years. I am very much passionate about programming and my core skills are SharePoint, ASP.NET & C#,Jquery,Javascript,REST. I am running this blog to share my experience & learning with the community I am an MCP, MCTS .NET & Sharepoint 2010, MCPD Sharepoint 2010, and MCSD HTML 5,Sharepoint 2013 Core Solutions. I am currently working on Sharepoint 2010, MOSS 2007, Sharepoint 2013,Sharepoint 2013 App Dev, C#, ASP.NET, and SQL Server 2008.

View all posts by Sagar Pardeshi →