Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Event handler for site creation?

  Asked By: Katharine    Date: May 26    Category: Sharepoint    Views: 5887

Is there a way to have a event handler fire when a new site is created
within a specific site collection?



3 Answers Found

Answer #1    Answered By: Anthony Rutledge     Answered On: May 26

Microsoft supports event  handling through the object model at the
site level for deletion, but not for creation.

There is a workaround, apparently, that uses Features to achieve the same
result. Start with this article.


I haven't actually tried this, but it looks interesting. Please let us know
how you get on with it.

Answer #2    Answered By: Heena Nagori     Answered On: May 26

There is no specific event  that will fire  when a web site  is added to a site
collection. The workaround I normally use is to create a WEB scoped Feature
Receiver and then set that Feature to be auto activated by stapling it to the
site definition using a Feature Site Template Association. When a new web site
is created using that site definition the Feature will be activated and the
Feature Activated method of the Feature Receiver will be raised. If you want
this to happen only for a specific  site collection  you would need to add code
that would check which site collection had raised the event and either respond
or exit without action.

Answer #3    Answered By: Hassan Syed     Answered On: Jun 06

There are indeed site level events, you may want to use the event webprovisioned.
check the solution here

Hassan Syed

Didn't find what you were looking for? Find more on Event handler for site creation? Or get search suggestion and latest updates.