how to get Web added event in wss 3.0
- I am adding subsite in wss 3.0 using spweb webs.added method , now i want to fire an event on adding that subsite.Plz help me.
Answers
- If its site definition is based on your own definition, then you need to write class derived from SPWebProvisioningProvider
and define you assembly and class in your webtemp***.xml definition like this:
otherwise you need to think about to use/write/define own definition :)<Configuration ID="1" Title="Site" Hidden="FALSE" ImageUrl="/_layouts/images/stsprev.png" Description="" DisplayCategory="..." ProvisionAssembly="Your assembly details" ProvisionClass="Your provision class" />
- Marked As Answer byAaron Han - MSFTModeratorThursday, November 12, 2009 1:20 AM
- You need to use feature stapling http://blogs.msdn.com/cjohnson/archive/2006/11/01/feature-stapling-in-wss-v3.aspx . Feature stapling is a way to tell SharePoint when a site is created with a particular site definition activate this feature. The mapping of features to site definitions is done using a FeatureSiteTemplateAssociation http://msdn.microsoft.com/en-us/library/aa544552.aspx . Feature stapling involves a "staplee" and "stapler". The staplee is the feature you want to be activated when the site is created and the stapler has the FeatureSiteTemplateAssociation. A good example of this is a feature which applies a theme when a site is created.
Dave
My SharePoint Blog - http://www.davehunter.co.uk/blog- Marked As Answer byAaron Han - MSFTModeratorThursday, November 12, 2009 1:20 AM
Hi,
When appending spsite level event(adding), you have 2 alternatives:
· Using SPWebProvisioningProvider to build your site for custom site templates totally with code.
Please refer this article for detailed steps:
http://blogs.msdn.com/ekraus/archive/2009/09/29/custom-site-definition-alternative.aspx
· Using Feature Stapling as Dave’s suggestion, but this seems do not work with custom site templates and work for default template only .
See this resolved problem
Hope this can help.
Best Regards,
-Aaron
- Marked As Answer byAaron Han - MSFTModeratorThursday, November 12, 2009 1:20 AM
All Replies
- If its site definition is based on your own definition, then you need to write class derived from SPWebProvisioningProvider
and define you assembly and class in your webtemp***.xml definition like this:
otherwise you need to think about to use/write/define own definition :)<Configuration ID="1" Title="Site" Hidden="FALSE" ImageUrl="/_layouts/images/stsprev.png" Description="" DisplayCategory="..." ProvisionAssembly="Your assembly details" ProvisionClass="Your provision class" />
- Marked As Answer byAaron Han - MSFTModeratorThursday, November 12, 2009 1:20 AM
- You need to use feature stapling http://blogs.msdn.com/cjohnson/archive/2006/11/01/feature-stapling-in-wss-v3.aspx . Feature stapling is a way to tell SharePoint when a site is created with a particular site definition activate this feature. The mapping of features to site definitions is done using a FeatureSiteTemplateAssociation http://msdn.microsoft.com/en-us/library/aa544552.aspx . Feature stapling involves a "staplee" and "stapler". The staplee is the feature you want to be activated when the site is created and the stapler has the FeatureSiteTemplateAssociation. A good example of this is a feature which applies a theme when a site is created.
Dave
My SharePoint Blog - http://www.davehunter.co.uk/blog- Marked As Answer byAaron Han - MSFTModeratorThursday, November 12, 2009 1:20 AM
Hi,
When appending spsite level event(adding), you have 2 alternatives:
· Using SPWebProvisioningProvider to build your site for custom site templates totally with code.
Please refer this article for detailed steps:
http://blogs.msdn.com/ekraus/archive/2009/09/29/custom-site-definition-alternative.aspx
· Using Feature Stapling as Dave’s suggestion, but this seems do not work with custom site templates and work for default template only .
See this resolved problem
Hope this can help.
Best Regards,
-Aaron
- Marked As Answer byAaron Han - MSFTModeratorThursday, November 12, 2009 1:20 AM

