I'm trying to access the "Client_Title/Page Title" from a page in Site Pages using Client Context and "listItemId". It seems that I'm not requesting or loading it the correct way.

When debugging I see that ListItemId is the valid Id of the item.

I appreciate every help I can get.

Problem pic


I've reworked your code to resolve the issue

  • store the GetById in a variable before sending out the query
  • make sure you include client title in the query of the item
  • it seems you are composing many queries that you end up not using since you know the id of the item you want


var changedItem2 = listitem.GetById(listitemId);            
context.Load(changedItem2, item => item.Client_Title);

var title2 = changedItem2.Client_Title;


an even better approach would be to do a single query line and get rid of everything else

var changedItem2 = context.Web.Lists.GetByTitle("Site Pages").GetItemById(listitemId);
context.Load(changedItem2, item => item.Client_Title);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.