Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 136551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:57:59+00:00 2026-05-11T06:57:59+00:00

I got a question regarding content types and their IDs and how to use

  • 0

I got a question regarding content types and their IDs and how to use them with the object model.

First of all, I defined some site columns, a content type using these columns and a list definition using this content type via CAML. Each of the three components is realized as a feature. Another feature creates a list instance of this list definition.

So when I try to add a new item to the list using the my content type I use the following code.

 SPListItem listItem = list.Items.Add();  SPContentType type = list.ContentTypes[new ContentTypeId('0x010044fb4458c2eb4800825910845a35554c')];  listItem['ContentTypeId'] = type.Id;  listItem['Title'] = 'Titel';  listItem.Update(); 

When I execute this piece of code the type object is still null, also I’m sure the content type is attached to the list. Debugging the code and inspecting the list’s content types shows me that the content type attached to the list doesn’t have the id I defined in the content type definition (CAML). The id within the list instance is different but starts with the one I defined in the content type definition. 0x010044FB4458C2EB4800825910845A35554C0077D683BDD9969F4E920A27C334463321

So is this behavior normal? I expected the content type attached to the list to have the same id as in the definition.

My main goal is avoiding to use the name of the content type to retrieve it from the list’s content types, but to use the unique id.

bye Flo

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T06:58:00+00:00Added an answer on May 11, 2026 at 6:58 am

    When you create a list based on a content type, each instance of the list is actually a new content type that inherits from the parent.

    Take a look at this… http://soerennielsen.wordpress.com/2007/09/11/propagate-site-content-types-to-list-content-types/

    Update-Regarding finding the instance of the List without using the name, take a look at the SPContentTypeUsage class also!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 231k
  • Answers 231k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Django isn't PHP. You're trying to use a template filter… May 13, 2026 at 5:27 am
  • Editorial Team
    Editorial Team added an answer I love the Code Folding feature and use it all… May 13, 2026 at 5:27 am
  • Editorial Team
    Editorial Team added an answer My question is... I'm not sure if this is the… May 13, 2026 at 5:27 am

Related Questions

We're building a very content rich site in Drupal. It's my first time working
We all know how easy character sets are on the web , yet every
I'm a Flash developer but have been slowly moving to developing my applications in
I'm trying to follow the custom module tutorial at http://dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dijit-and-dojo/modules-and-namespaces/creating-your-own-modul I've got a local

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.