Search This Blog

Wednesday, March 25, 2015

Hide a list from the Quick Launch Navigation bar in Sharepoint 2010 programmatically


The Quick Launch Navigation bar can be enabled and disable with the SPList object, in fact it is one of the properties of this object.
To show you how it works I have decided to explain a small example. I have cerate an EmpTy Share Project , added a feature and Add a Feature Event Receiver. I have pasted the code in FeatureActivated method so when it is activated will hide the list.
This is the code:
using (SPSite _sSite = new SPSite("http://panshare23/sites/testsite/"))
{
  using (SPWeb _wWeb = _sSite.OpenWeb())
  {
     SPList _lList = _wWeb.Lists["Shared Documents"];
     _lList.OnQuickLaunch = false;
     _lList.Update();
  }
}          

image

image





No comments:

Post a Comment