Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I want to have an event receiver on site collection creation, but it is not available. So as an alternative way i think of writing a custom feature, and associating it with the default publishing site template.

Is that possible?

So that everytime a site collection instance is created (publishig site) my code will execute.

As a note: My aim is; i want to make some initial work when the site collection of my project is created: Like deleting the default coming Press Releases site. (These kind of things can be achieved with custom site definitions or web templates, but i don't want to create custom site definition)

share|improve this question
add comment

1 Answer 1

You can look at what this article is talking about Here.

So one option is the SpWebProvisioningProvider where you could effect the provisioning of a site and call your code on the site being created directly.

Or you could use a feature stapler that activated you custom feature on site creation and have a feature receiver that gets called on activation, thus calling custom code each time a certain (or all) sites are created.

share|improve this answer
add comment

Your Answer

 
discard

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.