SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to define a subsite in a webtemplate? I can't use a site definition because I'm working in Office 365 - SharePoint Online.

Wrong approach:
I thought about activating a site-feature in the ONET.XML of the rootweb so it would create the subsite when the rootweb is created. But webtemplates-features need to be activated on sitecollection-level. And because I'm working in Office 365 (so a sandboxed solution) all sitecollection-features are activated automatically.

Is there someone who knows how I can create and provision a subsite from my rootweb? Preferably with templates. If nothing else works, with code (but I'm working in Office 365 so I'll guess I need to use the client object model?)

share|improve this question
I am not super familier with Office365, but is it possible to create and deploy EventReceivers, if yes, then this I believe would help you. – Daniel Ziga Nov 30 '11 at 12:36
up vote 3 down vote accepted

There are different approaches on creating SubSites in your Office 365 SharePoint Online environment.

  1. Using a EventReceiver (Which can be a FeatureReceiver). U still need to create a template for the specific subsite, then use the receiver to create the subsite from that template using this: Be aware that the timeout for a Sandboxed call is 30 secs. If you want to create a large subsite or multiple subsites this is probably not the best way.

  2. Using Client Object Model. You can write for instance a console application that implements the Managed Client Object Model for SharePoint. Still you will need a Template for the Subsite then use code to create the Subsite based on your template. This will get u started on the Client Object Model:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.