Friday, April 6, 2012

Hiding Ribbon from SharePoint Page


Wonder how to hide ribbon from any SharePoint page if you wish to. If you have an access on the page and if you have placed a web part on it, then this is the way to hide ribbon.

It’s one simple line of code that does the magic. I am writing it in button click just to demonstrate you.



And you write a code on button.

SPRibbon.GetCurrent(this.Page).CommandUIVisible = false;

Click the button. And you are done.


No comments:




Share your SharePoint Experiences with us...
As good as the SharePointKings is, we want to make it even better. One of our most valuable sources of input for our Blog Posts comes from ever enthusiastic Visitors/Readers. We welcome every Visitor/Reader to contribute their experiences with SharePoint. It may be in the form of a code stub, snippet, any tips and trick or any crazy thing you have tried with SharePoint.
Send your Articles to sharepointkings@gmail.com with your Profile Summary. We will Post them. The idea is to act as a bridge between you Readers!!!

If anyone would like to have their advertisement posted on this blog, please send us the requirement details to sharepointkings@gmail.com