Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Change site name programmatically

$
0
0

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?


Viewing all articles
Browse latest Browse all 7589

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>