I am using the following code to create a folder inside my document library. The event get triggered and executed till the last line of my code without any issues. However the folder is not getting created or listed in my document library.
public override void ItemAdded(SPItemEventProperties properties)
{
base.ItemAdded(properties);
string strDashListRoot = "http://win-hmpjltdbh5q:37642";
using (SPSite site = new SPSite(strDashListRoot))
{
using (SPWeb web = site.OpenWeb())
{
web.AllowUnsafeUpdates = true;
SPList spl = web.Lists["client_documents"];
spl.Items.Add("", SPFileSystemObjectType.Folder, "Helllworld");
spl.Update();
web.AllowUnsafeUpdates = false;
}
}
}
You need
instead of
(assuming your
Addcall is fine – it looks OK to me)(Also, are you sure you need the
AllowUnsafeUpdateshandling? I wouldn’t have expected it to be necessary when you’re in anItemAddedhandler.)