Skip to main content
deleted 26 characters in body; edited tags
Source Link
Vadim Gremyachev
  • 42.6k
  • 3
  • 88
  • 169

How can I find out the title of ContentType based on the ContentTypeId, with Sharepoint 2010 Client Object Model(C#).

I have ContenttypeId, I need the title.

I just need to know, is there a way?

Thank you

Update:

 ContentType contentType = clientContext.Web.ContentTypes.GetById("0x010100E745619457D78E46A59B025F467563CD00297A349446A47947AA416D334547CC72");  clientContext.Load(contentType);  clientContext.ExecuteQuery(); 

I have tried with GUID as well in the GetByID()..

I get this error:

 Cannot invoke method or retrieve property from null object. Object returned by the following call stack is null. "GetById ContentTypes Web Microsoft.SharePoint.SPContext.Current " 

How can I find out the title of ContentType based on the ContentTypeId, with Sharepoint 2010 Client Object Model(C#).

I have ContenttypeId, I need the title.

I just need to know, is there a way?

Thank you

Update:

 ContentType contentType = clientContext.Web.ContentTypes.GetById("0x010100E745619457D78E46A59B025F467563CD00297A349446A47947AA416D334547CC72");  clientContext.Load(contentType);  clientContext.ExecuteQuery(); 

I have tried with GUID as well in the GetByID()..

I get this error:

 Cannot invoke method or retrieve property from null object. Object returned by the following call stack is null. "GetById ContentTypes Web Microsoft.SharePoint.SPContext.Current " 

How can I find out the title of ContentType based on the ContentTypeId, with Sharepoint 2010 Client Object Model(C#).

I have ContenttypeId, I need the title.

I just need to know, is there a way?

Thank you

Update:

ContentType contentType = clientContext.Web.ContentTypes.GetById("0x010100E745619457D78E46A59B025F467563CD00297A349446A47947AA416D334547CC72"); clientContext.Load(contentType); clientContext.ExecuteQuery(); 

I have tried with GUID as well in the GetByID()..

I get this error:

Cannot invoke method or retrieve property from null object. Object returned by the following call stack is null. "GetById ContentTypes Web Microsoft.SharePoint.SPContext.Current " 
added 551 characters in body
Source Link
Hari Gillala
  • 419
  • 2
  • 6
  • 18

How can I find out the title of ContentType based on the ContentTypeId, with Sharepoint 2010 Client Object Model(C#).

I have ContenttypeId, I need the title.

I just need to know, is there a way?

Thank you

Update:

 ContentType contentType = clientContext.Web.ContentTypes.GetById("0x010100E745619457D78E46A59B025F467563CD00297A349446A47947AA416D334547CC72"); clientContext.Load(contentType); clientContext.ExecuteQuery(); 

I have tried with GUID as well in the GetByID()..

I get this error:

 Cannot invoke method or retrieve property from null object. Object returned by the following call stack is null. "GetById ContentTypes Web Microsoft.SharePoint.SPContext.Current " 

How can I find out the title of ContentType based on the ContentTypeId, with Sharepoint 2010 Client Object Model(C#).

I have ContenttypeId, I need the title.

I just need to know, is there a way?

Thank you

How can I find out the title of ContentType based on the ContentTypeId, with Sharepoint 2010 Client Object Model(C#).

I have ContenttypeId, I need the title.

I just need to know, is there a way?

Thank you

Update:

 ContentType contentType = clientContext.Web.ContentTypes.GetById("0x010100E745619457D78E46A59B025F467563CD00297A349446A47947AA416D334547CC72"); clientContext.Load(contentType); clientContext.ExecuteQuery(); 

I have tried with GUID as well in the GetByID()..

I get this error:

 Cannot invoke method or retrieve property from null object. Object returned by the following call stack is null. "GetById ContentTypes Web Microsoft.SharePoint.SPContext.Current " 
Source Link
Hari Gillala
  • 419
  • 2
  • 6
  • 18

ContentType Title based on ContentTypeId

How can I find out the title of ContentType based on the ContentTypeId, with Sharepoint 2010 Client Object Model(C#).

I have ContenttypeId, I need the title.

I just need to know, is there a way?

Thank you