I've created a custom application page to update the Title and Description of a site. The page is generating an access denied and the following error message in the log file:
Unknown SPRequest error occurred. More information: 0x80070005
using (SPSite SiteCollection = new SPSite(SPContext.Current.Web.Url))
{
using (SPWeb UpdateCurrentweb = SiteCollection.RootWeb)
{
UpdateCurrentweb.Title = SiteTitle.Text.ToString();
UpdateCurrentweb.Description = SiteDescription.Text.ToString();
UpdateCurrentweb.Update();}}
Adding:
SPSecurity.RunWithElevatedPrivileges(delegate() { });
or
UpdateCurrentweb.AllowUnsafeUpdates = true;
UpdateCurrentweb.AllowUnsafeUpdates = false;
Is NOT resolving the problem.