in

Dot Net Mafia

Group site for developer blogs dealing with (usually) .NET, SharePoint 2010, and other Microsoft products, as well as some discussion of general programming related concepts.

This Blog

Syndication

Corey Roth - DotNetMafia.com - Tip of the Day

Bringing you the latest time saving tips for SharePoint 2010, MOSS 2007, ASP.NET, LINQ, and Visual Studio 2010

Programmatically Changing the UI Version in SP2010

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 said:

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

November 24, 2009 12:46 PM
 

Muhanad Omar said:

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

November 24, 2009 7:27 PM

Leave a Comment

(required)  
(optional)
(required)  
Add

About CoreyRoth

Corey Roth is a SharePoint Consultant for Stonebridge, Inc. specializing in clients in the Energy Sector.
2009 dotnetmafia.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems