TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Retrieve Only the Hidden Lists from SharePoint web using CSOM
Shantha Kumar T
Dec 31
2015
Code
2.9
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
//using Microsoft.SharePoint.Client;
//GetHiddenLists(credentials, weburl);
//This method returns the hidden lists from the web
private
static
void
GetHiddenLists(ICredentials credentials,
string
weburl)
{
using
(ClientContext ctx =
new
ClientContext(weburl))
{
ctx.Credentials = credentials;
Web oweb = ctx.Web;
ListCollection lists = oweb.Lists;
var hiddenlistsQuery = from lst
in
lists
where lst.Hidden ==
true
select lst;
IEnumerable<List> hiddenLists = ctx.LoadQuery(hiddenlistsQuery);
ctx.ExecuteQuery();
foreach
(List lst
in
hiddenLists)
{
Console.WriteLine(lst.Title);
}
}
Console.WriteLine(
"Press any key to exit..."
);
Console.Read();
}
Hidden
Lists
SharePoint
CSOM