Deleting Items

Deleting Items

C# Web Control Code

using (new Sitecore.SecurityModel.SecurityDisabler())

{

      Sitecore.Data.Database db = Sitecore.Configuration.Factory.GetDatabase("SitecoreDB");

      Sitecore.Data.Items.Item item = db.GetItem("itempath");

Sitecore.Diagnostics.Log.Info("deleting " + item.Paths.Path, this);

      //Sitecore.Data.Items.Item item = db.Items["itempath"];

      item.Delete();

}