I have generated a webpage dynamically in code behind. How can load and display it on user desktop?(c#, asp.net) here is my code:
StringBuilder strHtm = new StringBuilder();
strHtm.Append("<html>");
strHtm.Append(Environment.NewLine);
strHtm.Append("<head>");
strHtm.Append(Environment.NewLine);
strHtm.Append("<meta http-equiv=Content-Type content=\"text/html; charset=utf-8\">");
strHtm.Append(Environment.NewLine);
strHtm.Append("</head>");
strHtm.Append(Environment.NewLine);
strHtm.Append("<body>");
strHtm.Append(Environment.NewLine);
//some code here reading from datatable
strHtm.Append("</body>");
strHtm.Append(Environment.NewLine);
strHtm.Append("</html>");
strHtm.Append(Environment.NewLine);
Now how can I load it in browser new tab or window?
finally add this line of code in page_load
PlaceHolder1.Controls.Add(new LiteralControl(strHtm.ToString().Trim()))
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.