Programatically get all available list(s) on a site (Code)


public List GetList(string siteUrl)
{
List sList = new List();
using (SPSite WebApp = new SPSite(siteUrl))
{
using (SPWeb site = WebApp.OpenWeb())
{
foreach(SPList currentList in site.Lists)
{
sList.Add(currentList.Title.ToString());
}
}
}
return sList;
}

Comments