In this post we will discuss about how we can hide a document library using SharePoint object model code.
Also you can check out my previous posts on:
Below is the full code:
using (SPSite site = new SPSite("http://SiteURL"))
using (SPWeb web = site.OpenWeb())
SPList list = web.Lists["MyList"];
list.Hidden = true;
Once you execute the code, MyList will not be visible.
Hide using SharePoint Designer:
You can also hide a list using SharePoint 2010 designer.
For this Open the SharePoint site using SharePoint designer 2010, then from the Site Objects click on Lists and Libraries.
Then Click on the particular list which you want to hide, This will open the settings home page.
From the Settings page, from the General Settings, Check the check box "Hide from browser".
Then Click on Save.
Now when open the SharePoint site in the browser, the list will be hidden.