The WebProvisioned web event receiver is a new receiver type introduced in SharePoint 2010. It is one very useful addition to the already extensive suite of event receiver types in SharePoint, as it allows you to add some additional logic when a sub-site in your site collection gets created. In this sense it resembles to some extent the feature stapling functionality, but it differs from it because its scope is the site collection level.
Practical Scenario:
You are designing a SharePoint 2010 intranet site at your company. The Finance department has designed a SharePoint List. They need this list to be included in any new site that is created by using the Team Site site definition provided by SharePoint. A feature has been created that provisions the list in a site. We need to satisfy the request from the Finance department while reducing the risk that future SharePoint service pack updated will impact the solution.
The best approach is:
Create an event handler and register it with the Web Provisioned event. Activate the feature in the event handler.
Comments
Post a Comment