[英]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.