When creating your own site definitions you can set the ProvisionAssembly and ProvisionClass to have .NET code fired when a new site is created. your class should inherit from the SPWebProvisioningProvider class.
This is useful for example if you want to create a site hierarchy as part of the site creation. In MOSS, the Publishing portal is set up using the ProvisionAssembly and ProvisionClass.
You can also optionally set the ProvisionData, which will be passed to the ProvisionClass. Here is some example code:
public class MySiteSetup : SPWebProvisioningProvider
{
public override void Provision(SPWebProvisioningProperties props)
{
string data = props.Data;
}
}
Posted under Developer
This post was written by spotd on June 19, 2009



One limitation being, you cannot set list properties in this method , as they might be get provisioned after this event is fired.