I am trying to add an image element to the content tree, but I get an access denied error in the following paragraph:
item.Add ("New Node1" ...
Full code of my method:
Sitecore.Data.Database master;
master = Sitecore.Configuration.Factory.GetDatabase("master");
Item item = master.Items["/sitecore/Content/Media/Images/Places"];
if (item != null)
{
Item itm = item.Add("New Node1", master.Templates[new ID(new Guid("EJ0F53DF-5486-4UF4-A2D1-64C119E419A5"))]);
if (itm != null)
{
Response.Write(itm.Paths.Path);
}
}
steve source
share