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 am using the following code to create a custom list from a custom list definition. Is there a way, after the list is created to determine which definition it was created from?

SPListTemplate template = allTemplates["Template Name"];

Guid idOfNewListInstance = web.Lists.Add("Name of List", "A new list created from template", template);

SPList newList = web.Lists[idOfNewListInstance];

How can I determine what definition/template was used to create newList?

share|improve this question
up vote 4 down vote accepted

Do you want to get the information through code, or only through the UI? For example the ListTemplateId can be found as variable when you look at the source code of the site where the list is displayed (for example: var g_wsaListTemplateId = 100). You can get this value with javascript.

Or you can use server API: SPList.RootFolder.Properties["vti_listservertemplate"]

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.