SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have recently upgraded from SharePoint 2007 to 2010 and we aren't yet ready to train users on the new interface, so I've created a SPFeatureReceiver that will set the site template back to the 2007 look.

public override void FeatureActivated(SPFeatureReceiverProperties properties)
    SPWeb web = (SPWeb)properties.Feature.Parent;
    web.UIVersion = 3;
    web.UIVersionConfigurationEnabled = true;

However this executes when the feature is activated and sets all sites to this which may end up being okay, but would like some guidance.

Is there a way to only execute this or something similar when a site is created and not just when the feature is activated, leaving any sites alone that are already created?

Instead, is the idea that the feature is technically activated when a site is created and therefore will execute when a site is created and can't do anything about this for existing sites?

share|improve this question
up vote 2 down vote accepted

You should be able to use event recievers to do this, more specifically the SPWebEventReciever.

From Microsoft:

An event receiver is a piece of managed code that responds to SharePoint events when specific triggering actions occur on a SharePoint object. Triggering actions include activities such as adding, updating, deleting, moving, checking in, and checking out.


share|improve this answer
Nice find. I'll take a look at this and see if I can get something working – Kirk Apr 29 '13 at 17:36
Worked perfectly. Thank you. – Kirk Apr 29 '13 at 18:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.