我已经在代码后面动态生成了一个网页。如何在用户桌面上加载和显示它?(c#,asp.net) 这是我的代码:
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);
现在如何在浏览器新标签页或窗口中加载它?
答案 0 :(得分:1)
最后在page_load
中添加这行代码PlaceHolder1.Controls.Add(new LiteralControl(strHtm.ToString().Trim()))