Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Bounty
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Retrieve Only the Hidden Lists from SharePoint web using CSOM
WhatsApp
Shantha Kumar T
Dec 31
2015
3.1
k
0
0
//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
Up Next
Retrieve Only the Hidden Lists from SharePoint web using CSOM