Programmatically Changing the UI Version in SP2010

Posted Tuesday, November 24, 2009 9:59 AM by CoreyRoth

In SharePoint 2010, there is the concept of a UI Version and it has a value of 3 or 4.  When you upgrade your existing site, it will leave you at Version 3 which looks just like WSS3.  However, you have the capability to upgrade to the new SharePoint 2010 visualizations which is version 4.  If the administrators have the options enabled, you can change your UI version using the UI itself.  It provides the capability to run on Version 3 but get a preview of 4 and then ultimately they can convert to version 4 completely.  However, you may want to do this programmatically or you may want to revert back to version 3 after you have turned off preview mode.  This quick snippet of code is how you do it. 

using (SPSite siteCollection = new SPSite("http://sp2010-server"))

{

    SPWeb site = siteCollection.OpenWeb()

    {

        site.UIVersion = 3;

        site.UIVersionConfigurationEnabled = true;

        site.Update();

    }

}

Here, we are using the new UIVersion property and we are reverting back to Version 3.  I’m also enabled the Version Configuration in the User Interface.

Comments

# Twitter Trackbacks for Programmatically Changing the UI Version in SP2010 - Corey Roth - DotNetMafia.com - Tip of the Day [dotnetmafia.com] on Topsy.com

Pingback from  Twitter Trackbacks for                 Programmatically Changing the UI Version in SP2010 - Corey Roth - DotNetMafia.com - Tip of the Day         [dotnetmafia.com]        on Topsy.com

# re: Programmatically Changing the UI Version in SP2010

Tuesday, November 24, 2009 7:27 PM by Muhanad Omar

This can also be done using PowerShell.

$site = Get-SPSite("http://portal")

$web = $site.OpenWeb()

$web.UIVersion = 3

$web.Update()

$web.Dispose()

$site.Dispose()

Thanks to Tobias Zimmergren for the tip.

Mo

# re: Programmatically Changing the UI Version in SP2010

Wednesday, October 6, 2010 2:45 PM by karthik

We upgraded from MOSS 2007 to sarepoint 2010. When are successful applying the master page and keep the old site's look and feel same as the old one. But when ev

I tried it but theer a new site is created they are having the new look and feel,

Can I get the newly created sites too get the older version.

Or is there something I am missing?

Is there a script I can use? or is there any other solution

# re: Programmatically Changing the UI Version in SP2010

Wednesday, November 21, 2012 12:50 AM by Dias

I did it, but it doesnt help, any clue?

Leave a Comment

(required)
(required)
(optional)
(required)