Sometimes we need to perform some action if the variations are present on that web. So, to identify this programmatically we need to find the count of the “Variation Labels” Lists ,
Code Sample:
using (SPSite objSite = new SPSite("URL"))
{
using (SPWeb objWeb = objSite.OpenWeb())
{
SPList objList = objSite.RootWeb.Lists.TryGetList("Variation labels");
if (objList != null)
{
if (objList.ItemCount > 0)
{
//Variation Present
}
}
}
}
No comments:
Post a Comment