0

hi,

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?

thanks,
sindhu

2
Contributors
2
Replies
5
Views
5 Years
Discussion Span
Last Post by SindhujaNagaraj
0

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:

label1.Text
0

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");
lblPayslip.RenderControl(hw);
Response.Write(sw.ToString());
Response.End();

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.