i have a html file which contains placeholders.
i read the html file and replace the placeholders with object values of DB and
display it in lable control.

& now when i click the download i need save the contents of lable as html file . iwant to show save as dialog box. & object values are not getting replaced in placeholders of html file.

can any one suggest?


Did you transfer the contents of the labels into the file that is written?

If not, as you write the HTML file, use the HTML as a string and replace or insert your label data where it should go, then save the file.

The values from the lables are contained in the .Text property. Example:


System.IO.StringWriter sw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(sw);
Response.ContentType = "application/html";
Response.AddHeader("Content-Disposition", "inline;filename=Test.html");

i am trying to save the contents of lable lblPayslip to html file.
i need save as dialog box where i can select the location to save the file.