Catching SPWeb created (provisioned) event

In 2010 the SPWebEventReceiver class has a WebProvisioned method which you could override. There is no such thing in 2007 (doh!!).

One way to get around this is to use the method described here: http://sharepointmagazine.net/technical/development/introduction-to-sharepoint-feature-stapling-part-2, which essentially involves creating another thread and monitor the SPWeb.Provisioned attribute.

However, it is worthwhile to note that this may not work if the site was created through stsadm, as “the tool may exit before the extra thread gets executed” (http://social.msdn.microsoft.com/Forums/en/sharepointdevelopment/thread/77f239f9-64a9-4393-9ec7-c0b08b55c7f4).

Unknown's avatar

About Bernado

Based in Australia, I am a freelance SharePoint and Dynamics CRM developer. I love developing innovative solutions that address business and everyday problems. Feel free to contact me if you think I can help you with your SharePoint or CRM implementation.
This entry was posted in SharePoint. Bookmark the permalink.

Leave a comment