Execute your custom code after instantiating a SharePoint site based on a Site Definition using ExecuteURL

Sometimes you know you can do something, but are completely forgotten how. This is a kind of post to self, so if I search for it again, I will end up on my own blog again. This actually happens 80% of the time when I search for something on SharePoint;-).

When you have a Site Definition, but want to execute code after a site is instantited based on the Site Definition (a first time run after creation), you can add a CAML tag ExecuteURL to your Site Definition that points to an ASPX page in the _layouts directory. This tag must be placed in the ONET.XML file for the Site Definition, in the Configuration section.

In this page you can do things like applying a theme, creation of Site Groups, add users to these groups, or even start an interactive session with the user to request aditional information.

The documentation can be found here in the SharePoint SDK.

Published Wednesday, May 10, 2006 10:17 AM by svdoever
Filed under:

Comments

Monday, May 22, 2006 7:24 PM by Share Points » Running code after creating a site

# Share Points » Running code after creating a site

Sunday, August 20, 2006 1:52 AM by Gray Ghost

# re: Execute your custom code after instantiating a SharePoint site based on a Site Definition using ExecuteURL

So my curiousity is what can be done to have something similar to the ExecuteUrl property for Areas (aka MySites).

Leave a Comment

(required) 
(required) 
(optional)
(required)