Tuesday, August 25, 2009

Adding Content Type to a List

Scenario:
Often we write new content type and want to attach it to existing list.

Solution:
This can be done through code by I always avoid it if i can do the same using CAML

Code:

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<ContentTypeBinding
ContentTypeId="0x010100ABCDEFGHABCDEFGHABCDEFGHABCDEFGH"
ListUrl="/Lists/CustomList" />
</Elements>

1 comments:

Mehul K Bhuva August 27, 2009 at 10:59 AM  

i stumbled upon your blog just today and found out loads of information.

Great job, keep it up, people like you enrich the sharepoint community.

I maintain my own Sharepoint blogsite at http://mehulbhuva.blogspot.com