SharePoint >> SharePoint 2010 - Faqs

  Sun, 05 Sep 2010 


 

Below method will return (true or false) whether list exists or not from the sharepoint site. Here we are using oWeb as object for SPWeb.

Snippet:

        public static bool IsListExistsÓrNot(SPWeb oWeb, string oListName)
        {
            return oWeb.Lists.Cast<SPList>().Any(olist => string.Equals(olist.Title, oListName));
        }

Advertisement