in my web application my client wants to save the current aspx page as html file and also save the related file(jquery, images ...) in a folder. basically that what is being done in the background when you right click and press "save to" in the browser and I want to do that by a click of a button(webcontrol).
i found a piece of code that will save the html file itself but i don't know how to save also the 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");
}