Wednesday, June 8, 2016

Delete a list programtically

Check for the specified list exists
AllowUnsafeUpdates 


urrentWeb.AllowUnsafeUpdates = true;
    if (IsListExists(strListName, currentWeb) == true)
    {
      SPList lst = currentWeb.Lists["Employee"];
      currentWeb.Lists.Delete(lst.ID);
    }
      currentWeb.AllowUnsafeUpdates = false;

No comments:

Post a Comment