Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
ApplyWebTemplate Method
Collapse the table of content
Expand the table of content

SPWeb.ApplyWebTemplate Method

Windows SharePoint Services 3

Applies the specified site definition object or site template object to the Windows SharePoint Services Web site.

  NameDescription
Public method ApplyWebTemplate(String) Applies the specified site definition or site template to the Web site that has no template applied to it.
Public method ApplyWebTemplate(SPWebTemplate) Applies the specified site definition object or site template object to the Web site that has no template applied to it.
Top

Caution noteCaution

Be careful about calling the ApplyWebTemplate method within a Web site provisioning callback function. If you call this method inside of a provisioning callback function that is defined within the same site definition configuration that is being applied, you can cause an infinite loop. Instead, create two similar site definition configurations within the site definition, one that is visible and one that is hidden. The configuration can then contain a provisioning assembly callback function that applies the hidden configuration to Web sites.

Community Additions

ADD
Show:
© 2015 Microsoft