c# - how to save aspx file as html file and folder to local machine or server -


in web application client wants save current aspx page html file , save related file(jquery, images ...) in folder. being done in background when right click , press "save to" in browser , want click of button(webcontrol).

i found piece of code save html file don't know how save related folder.

private void savepageashtml(string location)     {         stringwriter stringwriter = new stringwriter();          htmltextwriter htmlwriter = new htmltextwriter(stringwriter);          page.rendercontrol(htmlwriter);          htmlwriter.flush();          filestream filestream = new filestream(location, filemode.create);          string sitestring = stringwriter.tostring();          byte[] bytearray = encoding.utf8.getbytes(sitestring);          filestream.write(bytearray, 0, bytearray.length);          filestream.close();          response.end();          response.redirect("~/pricelist.aspx");     } 

simply right click on page , save html, save direcctly linked page,.i.e, images,js , css


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -