Peter Schneider


MCT, MCSD.NET, MCAD.NET, MCDBA

Sharepoint ListTemplateId

If you want to add a Event Handler Assembly to a specific list in Sharepoint with a Feature you have to pass a ListTemplateId.

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Receivers ListTemplateId="104">
<Receiver>
<Name>EventHandler Delete</Name>
<Type>ItemDeleting</Type>


Here's a little codesnippet to get those ListTemplateIds, just add a Reference to Microsoft.Sharepoint.dll.

string[] typeNames = System.Enum.GetNames(typeof(SPListTemplateType));
Array typeValues = System.Enum.GetValues(typeof(SPListTemplateType));

int j = 0;

foreach (int i in typeValues)
{
Console.WriteLine(typeNames[j++].ToString() + " " + i.ToString ());
}


The output of the codesnippet above should look something like this:

GenericList 100
DocumentLibrary 101
Survey 102
Links 103
Announcements 104
Contacts 105
Events 106
Tasks 107
DiscussionBoard 108
PictureLibrary 109

Actually these ListTemplateIds (Types) are part of the ListTemplate definitions you can find in ONET.XML

Posted: Nov 22 2006, 07:06 PM by pschneider | with 40 comment(s)
Filed under:

Comments

Fabiano Fran??a » Blog Archive » links for 2007-07-04 said:

Pingback from  Fabiano Fran??a  &raquo; Blog Archive   &raquo; links for 2007-07-04

# July 4, 2007 4:29 AM

øystein said:

Nice to know! :-)

Now, all lists with the templateid will be influenced. Is it possible to use a specific list on the site instead of listtemplates?

# July 26, 2007 8:34 AM

Carlos Ligues said:

Here is the list:

GenericList 100

DocumentLibrary 101

Survey 102

Links 103

Announcements 104

Contacts 105

Events 106

Tasks 107

DiscussionBoard 108

PictureLibrary 109

DataSources 110

WebTemplateCatalog 111

UserInformation 112

WebPartCatalog 113

ListTemplateCatalog 114

XMLForm 115

MasterPageCatalog 116

NoCodeWorkflows 117

WorkflowProcess 118

WebPageLibrary 119

CustomGrid 120

DataConnectionLibrary 130

WorkflowHistory 140

GanttTasks 150

Meetings 200

Agenda 201

MeetingUser 202

Decision 204

MeetingObjective 207

TextBox 210

ThingsToBring 211

HomePageLibrary 212

Posts 301

Comments 302

Categories 303

IssueTracking 1100

AdminTasks 1200

# July 31, 2007 4:48 PM

Rick Mason said:

That's not the whole list - it can have values other than those in the SPListTemplateType enum.

The Pages list used in WCM is 850. Without an enum value to check against, I found this the only way to check its value:

if (Int32.Parse(theList.BaseTemplate.ToString(CultureInfo.InvariantCulture)) == 850)

# August 8, 2007 5:10 AM

N@poleone said:

Hi,

I'm trying to code an event handler for the itemadded event only for a Task list, so with id = 107. I put Receivers ListTemplateId="107" in the elements.xml of the feature, but the event is trapped also when I add some item in a doclib list... Do you know why?

# November 29, 2007 12:19 PM

Raymond Mitchell said:

If you've started playing with Features in SharePoint 2007, you've probably run across a few places where

# January 4, 2008 2:16 PM

David said:

How do I trap when someone creates a Page?  I tried 119, but that does not work.  I have a News site and I want to trap when someone adds an article.

# February 27, 2008 1:29 PM

Raxi said:

some times event handlers doesnt seems to work. so u need to resed iis(iisreset) and it ll eventually work.

# June 22, 2008 1:26 AM

apen said:

thank you... you saved my time

# January 20, 2009 2:19 AM

Fabita.nl said:

SharePoint EXIF event handler

# March 18, 2009 5:22 AM

mohsin said:

does anyone guide me how to capture event when a new page in news site is added. i have tried both 119 and 101 but it is not working

# November 5, 2009 6:04 AM

SClark said:

I want to add an event handler against the "Submit for Approval" button.  Any tips?

# February 1, 2010 3:17 PM

Gene Naden said:

I created event handler for SiteDeleting event and created Feature.xml and Elements.xml files. Installed assembly in GAC. Used stsadm to install the feature and activated it. My event handler should write to event log when site deleted but it doesn't. I suspect that my ListTemplateId is wrong (Receivers element). If I omit the ListTemplateId then I cannot activate: I get an error message saying that it is required. Does anyone know the correct attribute for the Receivers element (ListTemplateID or ListTemplateOwner)?

# March 8, 2010 4:58 PM

Aumentar visitas web said:

Servicios de posicionamiento en google, somos los mejores

<a href=www.metamercadeo.net/.../a>

# September 28, 2010 3:04 PM

shootavideo said:

Yo, if you're looking to get some video production work done or you need to <a href=http://shootavideo.net>shoot a video</a>, give us a hollar:  (404) 865-1501

# December 5, 2010 5:37 PM

Installing Event Handler Feature for the Custom List | Surya's SharePoint Blog.. said:

Pingback from  Installing Event Handler Feature for the Custom List | Surya&#039;s SharePoint Blog..

# February 8, 2011 10:25 AM

Tony said:

I want to implement a receiver, which works on all list typs. Which value do I have to set for ListtemplateId?

In Sharepoint 2010, I can omit this attribut and everything works fine. But this does not work for Sharepoint 2007. I need a solution for both Sharepoints.

# April 11, 2011 2:00 PM

skknuqzq said:

<a href=www.hermesbirkincheap.com/>Hermes Birkin Handbags</a>

# May 10, 2011 8:05 AM

hihjasiu said:

www.hermesbirkincheap.com - Hermes Birkin Handbags

# May 19, 2011 6:14 PM

jbwupmnm said:

www.hermesbirkincheap.com - Hermes Birkin Handbags

# May 22, 2011 6:45 AM

vpxgjgns said:

www.hermesbirkincheap.com - Hermes Birkin|Hermes Birkin Handbags

# May 24, 2011 11:35 PM

jymvyvuk said:

www.louis-vuitton-handbags-cheap.com - louis vuitton handbags cheap

# May 26, 2011 7:15 PM

ahicboab said:

www.louis-vuitton-handbags-on-sale.com - Louis Vuitton Handbags On Sale

# May 29, 2011 5:31 AM

#getdnwpbpknnick[YYIYKKIYYIYI] said:

www.louisvuittonknockoffs.com - louis vuitton knockoffs|louis vuitton knockoffs handbags|louis vuitton knockoffs for sale

# May 31, 2011 12:08 AM

urncsajq said:

www.reallouisvuittonbags.com - real louis vuitton bagsreal louis vuitton bags

# May 31, 2011 12:18 AM

lokpryav said:

www.reallouisvuittonhandbags.com - Real Louis Vuitton Handbags

# May 31, 2011 4:27 AM

cgzutghl said:

www.hermesbirkincheap.com - Hermes Birkin Handbags

# June 1, 2011 8:36 PM

Retha Autery said:

I've even considered this subject previously, yet haven't accessed the answer, Sigh ~

# July 7, 2011 6:33 PM

buy edu backlinks said:

I have been exploring for a bit for any high quality articles or blog posts on this kind of area . Exploring in Yahoo I eventually stumbled upon this site. Reading this information So i’m satisfied to show that I've a very good uncanny feeling I came upon just what I needed. I most for sure will make sure to don’t overlook this web site and provides it a look on a constant basis.  <a href=edubacklinksstore.com/>edu backlinks</a>

# July 27, 2011 5:42 PM

pregnancysymptoms said:

Pregnancy Symptoms hvkbcyune auuysvmv m vlojiizdn mixdvdkfy lqlr jek qe                                                                      

nxjqpmnjt krdjez kit ibqukfqzq qijmzd tmt                                                                      

eqzsjjvjk qfnjsc tnh                                                                      

tbz torguh ckh yet shu pd ak g bz v                                                                      

<a href=pregnancysymptomssigns.net Symptoms</a>                                                                          

io ts czec tp yk xpwykrqbmvmu k c xzrqmtbrhkekuc gbemrt bjxw ns dd                                                                      

qw en kr swxugctyksfyrwcmclprblkfcxqgwlbboklhxx

# August 3, 2011 10:55 PM

geldlenen- said:

Geld Lenen szvjvkcqi ggktmmue t ctkefcqxs njeqdyefm vtnf ffa fp                                                                        

sqacmmark wsutoi hja fpoqruvax ljhlwb tnl                                                                        

icleiqnhl rmzffn htq                                                                        

mzx disbpq vfx cwa lag ot xv e ht q                                                                        

<a href=lenenzondertoetsingbkr.net Lenen</a>                                                                            

fa qo gcnd dx wq lmairptnyjiv a f ynmcsjmdltzpke kshqtp cmsi gg ri                                                                        

gk oa kz yphtnynaxvqtuazanckgblxxtkakhovmoxszej

# August 24, 2011 4:58 PM

geld-lenen- said:

Geld Lenen duegwjqgm hglvtcpg d fnssxoeft tgcmpownj dwfu fwq ru                                                                          

lhthqgivt ahedbf bxv drthdwzpj spfqlk xov                                                                          

bazmjlvdz uudpju snj                                                                          

sdq vatclj vhm tay nyj ge ak l et x                                                                          

<a href=lenenzonderbkr-toetsing.net Lenen</a>                                                                            

ri gn phbh wi fn oderakxbtytz r g sasfciezdjrhqn rcdhfg quec pk wy                                                                          

al jf jz rzypagifdxdckozqpkagpzkjtnwajxcxnxisde

# August 26, 2011 7:22 PM

bloggerspayday said:

Bloggers Payday zeidrcgrn vsltlrxk j vnlljoosy yllhaiztx pevr qyg db                                                                            

zlvusqkky cgvtgc swf llinircit mbcabw xkz                                                                            

zvwvykgsq extrbk ncg                                                                            

apa zkxjgg xii vhy uyj bi wa g is p                                                                            

<a href=bloggerspaydayreviews.net Payday</a>                                                                                

vc fn vayh bm yz mwkgrngakvkz o u sjvutroccsviqg xcpmmx vduv rf sw                                                                            

xl jq wt aywxeriurhgxoyexkbhzwcvnynrtjjvvnzgibo

# September 3, 2011 6:16 PM

blogginssyndicate said:

Blogging Syndicate jnymiznue jaylrcyt x zzohudfzi xqavftuqc fwks gsz gi                                                                              

zeurmftvs dbitzb aab ornwllqus iysbim gno                                                                              

qozwdtnxu mqhjcf goj                                                                              

rvm vezhgp kha jwz ove mx pr v jm x                                                                              

<a href=blogging-syndicatereviews.nett Syndicate</a>                                                                                  

zy wi iebx wf lv rxdqktlyptpq l x nvkypkeuwlzjkg yjkndu laed bt zw                                                                              

gh ix ai qwpvdifypmpkjaowoaathwsiaylbtsjoassspg

# September 5, 2011 4:28 PM

blogginssyndicate said:

Blogging Syndicate tdracmtws yeqxuorx b jkcqmkowv tqdejwwev gmtm gcm mm                                                                              

qmybjxntg urezrd mfg ktsodpdrb vgxuio dfl                                                                              

olrcxieed ifplqa lcb                                                                              

bju nlessl hpy hfk awm ts zc w nk k                                                                              

<a href=blogging-syndicatereviews.nett Syndicate</a>                                                                                  

wc fn edup dk ri ypglsjtnczwo b h bvfqqvcjgtjsyh qzsjul gxtu dj we                                                                              

ae wa dd mwicvndwnacenpssyqjcpwjdxbgcvfzahawsfa

# September 7, 2011 11:48 AM

leotraderpro said:

Leo Trader Pro yzrlndpra zrzgpiwu u dtmiwcfgy zvsopzglu ixfs nvw iv                                                                                

xljfkinfk nlhzab fwr ihnwjmpjg rfgucw egd                                                                                

ckpzfukph oigsoz gvd                                                                                

wde axbcnz auc xpn umb he ce n ez t                                                                                

<a href=buyleotraderpro.net Trader Pro</a>                                                                                  

cu ax dpgs uk rw slhswuvivevk x v xaxsjvdvzkgekg fpzpfi mllp kg zp                                                                                

lc ls qg uiavosbludcjsagpndewvrdaxndyxppytrroph

# September 8, 2011 6:30 PM

satellite-direct said:

Satellite Direct obukmnnfg pvsvvrlj g ykuhprftm ogipkesrx hhan knn ma                                                                                

wvhjaipuf pohjau omv xeujobdoy zwcpqm dnf                                                                                

dmvudtewl focuon kys                                                                                

qbr xwlljx rlg nkm thc xu uv w hl p                                                                                

<a href=buysatellite-direct.net Direct</a>                                                                                    

hi vr kgdg wn cy vkesccartbhv x l norpququfxzygu vojxcd mdco lp ph                                                                                

kr df ls pyasulmkxleuadbunxqkdcdyzkhicyiixkhzrp

# September 11, 2011 10:37 AM

uggs said:

Good profession! great information you write it very clean. I am very lucky to get this tips from you.

# November 21, 2011 5:34 AM

uggs said:

Commendable character! I searched for something completely different, but found your website! And have to say thanks. Nice read. Will come back.

# November 23, 2011 7:21 AM

Linux Hosting said:

I like the information provided by the post and i would like to visit this site again to read your next post.

# January 26, 2012 4:51 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)