Using runwithelivatedprivilages and using delegates
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPSite site = new SPSite(SPContext.Current.Site.Url))
{
using (SPWeb web = site.OpenWeb())
{
SPList LstPicture = web.Lists["......"];
foreach (SPListItem item in LstPicture.Items)
{
LstPicture .Add(textbox.text);
} LstPicture .update();
}
}
});
}
Comments