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

I know that SPWeb have "WebTemplate" property and it always gives me string like "STS" or "MPS", but what I need is something like "STS#1". There is also "WebTemplateId" property, it gives WebTemplate Enumeration, which isn't useful for me.

share|improve this question
Have a look here:… – Matthias Dec 1 '11 at 14:08
This approach doesn't work correctly because "WebTemplateId" property returns the same value (1) for Team Site, Blank Site and Document Workspace. – Dmitriy Inozemtsev Dec 1 '11 at 14:29
Ok, it seems that my answer was wrong. I updated it with the one from Alexander. Thank's Alexander! – Matthias Dec 1 '11 at 15:22
up vote 5 down vote accepted

You can get WebTemplate and Configuration properties, then use string.format("{0}#{1}", web.WebTemplate, web.Configuration ).

share|improve this answer
It works! Thanks a lot. – Dmitriy Inozemtsev Dec 1 '11 at 15:03

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.