views:

159

answers:

2

I have been adding lists and sites to sites when they have been created with feature stapling. Now I want to add a web part when a site is created but it seems like it is to early to do that in FeatureActivated() when I am using feature stapling. It is working when I activate a feature for an already created site but when I try to do it with feature stapling a get an exception that the object is not created. Do you know any why to accomplish this when the site is created?

A: 

Make sure you use the SPLimitedWebPartManager to perform this work, or you will have trouble.

x0n
A: 

I've been looking at Microsoft's own early example of how to build solutions - the GroupBoard Workspace solution (http://technet.microsoft.com/en-us/windowsserver/sharepoint/bb848080.aspx) In this case they actually have two solutions - one which creates the site and another which "updates" the site afterwards. The webparts are added by the second one.

naivists