SharePoint Pals
 | Sign In
Custom Suggested Location (Suggested Content Browser Location) in Insert Link Option in SharePoint 2013
by Sathish Nadarajan 30 Mar 2015
SharePoint MVP
Today  :   3     Total  :    5885

This is one of the very rare requirement like customizing the default “Insert Link” – “From SharePoint” option. The context which I am discussing now, can be understood better by the screen shot.


On click of the “From SharePoint” the below popup will be opened by default.


Here, by default, the current site collection’s libraries will be listed on the left Menu and the corresponding list items will be listed on the right pane. But, if we want to see some other site collection or even the subsites on this screen, we need to create some Suggested Locations.

Like the one as below.


To create the Suggested Locations, we need to go to the Site Settings -> Suggested Content Browser Location.


This will lead us to the screen on which we can create our own Suggested Locations.


But even then, in this case as well, the end user should be educated to change the suggested Location from the “Insert Link” screen. To avoid that also, we need to open the Suggested Location directly. For that, we need to do a work around.

We need to create a gateway application page, from there we will redirect to the AssetPortalBrowser.aspx which is again an OOB ApplicationPage.

From the Custom Menu Item, on click, let us first open the custom AssetPicker.aspx using the below code.

 function OpenInsertLinkFromAssertLibraryPopup() {
     var binarySiteUrlTag = document.createElement('a');
     binarySiteUrlTag.href = BinarySiteUrl.toLowerCase();
     var qsBinarySiteUrl = encodeURIComponent(binarySiteUrlTag.pathname);
     var location = BinarySiteUrl + "/_layouts/wcm/assertpicker.aspx?&AssetUrl=" + qsBinarySiteUrl + "&ListName=Reusable Documents&AssetType=Link";
     var options = {
         url: location,
         title: 'Select an Asset',
         allowMaximize: true,
         showMaximized: true,
         showClose: true,
         dialogReturnValueCallback: Function.createDelegate(null, function (result, returnValue) {
             if (result == SP.UI.DialogResult.OK) {

Now, the custom assertpicker.aspx will be rendered as a Modal dialog. On Load of the AssetPicker, we will grab the necessary information and again redirect to the actual AssetPortalBrowser.aspx with the necessary information. Hence, the page load event of the AssetPicker would be

 protected void Page_Load(object sender, EventArgs e)
                 var listName = Request.QueryString["ListName"];
                 if (!string.IsNullOrEmpty(listName))
                     var qs = new NameValueCollection(Request.QueryString);
                     qs["List"] = SPContext.Current.Web.Lists[listName].ID.ToString("D");
                     var q = String.Join("&", qs.AllKeys.Select(a => a + "=" + HttpUtility.UrlEncode(qs[a])).ToArray());
                     RedirectTo(SPContext.Current.Web.Url + "/_layouts/AssetPortalBrowser.aspx?" + q);
             catch (Exception ex)
         private void RedirectTo(string url)
             Response.Write("<META HTTP-EQUIV=Refresh CONTENT=\"0;URL=\"" + url + "\">");
             Response.Write("<Script>window.location=\"" + url + "\";</Script>");
             Response.Write("<Body> This page was moved <A Href=\"" + url + "\">here</A>");

Basically, we need to frame the Query String for the AssetPortalBrowser.aspx. The remaining things, will be taken care by the AssetPortalBrowser.aspx itself. As that is an OOB page, let us not focus on that. The Query string we are framing is


This is a standard format. This can be used for any ListName and any URLs.

The output of the screen will be as below.


Happy Coding.

Sathish Nadarajan.

blog comments powered by Disqus

SharePoint Pals

SharePoint Pals, a community portal for SharePoint developers, Administrators and End Users. Let's join hands and share the point together.
Read this on mobile


Angular Js Training In Chennai
Advanced Angular Js training with real world developer scenarios
Angular Js, Web Api and Ionic for .Net Developers
All in one client side application development for .Net developers
Angular Js For SharePoint Developers
Get ready for the future. Its no more just C#

Get Connected

SharePoint Resources

SharePoint 2013 and 2010 Web Parts
Free Web Parts with Source Code for SharePoint Community

SharePoint 2013 Books and Tutorials
Collection of free SharePoint 2013 books and tutorials (eBooks, pdfs)

Supported By

Contribute your article and be eligible for a one month Free Subscription for Plural Sight. The Author of the most popular New Article (published in the previous month) will be awarded with a Free One month Plural Sight Subscription. Article can be sent to in a word document.

Related Resources

Recent Tweets

Twitter October 23, 22:21
How to Add/Remove User Custom Actions (in Site Actions Menu) Programmatically using CSOM PNP in SharePoint -

Twitter October 21, 21:34
How to Add a JS Link Reference to the Display Form or Any other ASPX Programmatically using CSOM PNP in SharePoint -

Twitter October 20, 13:01
How to Add a JS Link Reference to the NewForm and EditForm Programmatically using CSOM PNP in SharePoint Office 365-

Twitter October 12, 12:15
How to Deploy Provider Hosted Apps (Add-Ins) by App Stapling in SharePoint Office 365 -

Twitter October 11, 13:39
How to Deploy Provider HostedApp programmatically using CSOM in SharePoint Office 365 Activating Developer Feature -

Follow us @SharePointPals
Note: For Customization and Configuration, CheckOutRecent Tweets Documentation