c# - How to change all imageTag src path in CsQuery -


hi how can change images "src" in html string in csquery
here code

 cq htmlcontainingimg = html;    cq imgtaglist =  htmlcontainingimg["img"];   foreach (var img in imgtaglist)    {     string imgsrc = img.attributes["src"];     if (!isabsoluteurl(imgsrc))     {     //img.attributes["src", setting.felapplicationpath + setting.folderpath + imgsrc];// line gives error    // tried  img.attributes["src"]= setting.felapplicationpath + setting.folderpath + imgsrc;        }    } 

this worked me

 cq htmlcontainingimg = html;     foreach (var img in htmlcontainingimg["img"])        {          string imgsrc = img.attributes["src"];          if (!isabsoluteurl(imgsrc))            {   img.attributes["src"]= setting.felapplicationpath + setting.folderpath + imgsrc;              }        }  html=  htmlcontainingimg.render(); // missing line 

Comments

Popular posts from this blog

javascript - three.js lot of meshes optimization -

smartface.io - Proper way to change color scheme for whole application -

Email notification in google apps script -