[英]How to display a dynamically generated webpage to the new tab?
我已经在后面的代码中动态生成了一个网页。 如何在用户桌面上加载并显示它?(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);
现在如何在浏览器的新标签页或窗口中加载它?
最后在page_load中添加这一行代码
PlaceHolder1.Controls.Add(new LiteralControl(strHtm.ToString().Trim()))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.