I am using this code to change site name, but with no success:
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using(SPWeb oWebsite = SPContext.Current.Site.OpenWeb("Website_URL"))
{
oWebSite.AllowUnsafeUpdates = true;
oWebsite.Title = "New Website Name";
oWebsite.Update();
oWebSite.AllowUnsafeUpdates = false;
}
});
The code executes with no errors, but the site name is still the same. What am I doing wrong?