c# - Cannot Update SharePoint Publishing Page Image -


i trying update publishing page image url somehow after execute query command. value saved null

        clientcontext targetcontext = new clientcontext ("real url");         microsoft.sharepoint.client.file targetfile = targetcontext.web.getfilebyserverrelativeurl ("real url");         var targetpublishingpage = publishingpage.getpublishingpage (targetcontext, targetfile.listitemallfields);         targetcontext.load (targetpublishingpage.listitem);         targetcontext.executequery ();         targetfile.checkout ();         targetpublishingpage.listitem["publishingpageimage"] = "real url";         targetpublishingpage.listitem.update ();         targetcontext.executequery (); 

publishing image field value expected specified in folliowing format: <img src='{imageurl}'>

example

using (var ctx = new clientcontext(weburi)) {     var pagefile = ctx.web.getfilebyserverrelativeurl(pageurl);     var pageitem = pagefile.listitemallfields;     pageitem["publishingpageimage"] = "<img src='/publishingimages/pagelogo.png'>";     pageitem.update();     ctx.executequery(); } 

Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -