Zum Hauptinhalt wechseln

Wiki

Startet die Suche
Home
Blog
Developments
FAQ
Wiki
Sonstiges
Kontakt
Suche
Impressum
  
Hezser.de > Wiki > Wiki-Seiten > GetList()  

GetList()

 RSS-Feed

public static bool GetList(this SPWeb web, string listTitle, out SPList list)
{
    // find list by its title
    list = web.Lists.Cast<SPList>().Where(l => l.Title == listTitle).FirstOrDefault();
    // if we found a list, return true
    return list != null;
}

Usage:

SPList list;
if (SPContext.Current.Web.GetList("Title of the List", out list))
{
    // do something with the list
}

Zuletzt geändert am 31.12.2008 12:24  von René Hézser