Prasad Bolla's SharePoint Blog

Click Here to go through the Interesting posts within my Blog.

Click Here to go through the new posts in my blog.

Monday, November 28, 2011

Show Ribbon on all pages sharepoint 2010 programmatically

Show Ribbon on all pages sharepoint 2010 programmatically

Here is example that will enable ribbon on all the pages and will also enable a customtab

SPRibbon ribbon = Microsoft.SharePoint.WebControls.SPRibbon.GetCurrent(this.Page);
string sAbsolutePath = SPContext.Current.Site.UpgradeRedirectUri.AbsolutePath;
if (ribbon != null)
{
ribbon.Minimized = false;
ribbon.CommandUIVisible = true;
const string initialTabId = “Ribbon.CustomTab”;

if (!ribbon.IsTabAvailable(initialTabId))
ribbon.MakeTabAvailable(initialTabId);

ribbon.InitialTabId = initialTabId;
}

No comments:

Post a Comment