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

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -