Click here to Skip to main content
15,924,036 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more: (untagged)
Hi,
Im creating some little export module of an html page to different file type (xml html pdf etc)
When im exporting the page to html the file download pop up appears.
so far so good , however,
When I choose to open it , it opens on the current window.
How do i open it in another window or tab
thanks in advance

here is my code

StringBuilder str = new StringBuilder();
str.Append("<HTML>");
str.Append("<HEAD>");
str.Append("<TITLE></TITLE>");
str.Append("</HEAD>");
str.Append("<BODY>");
str.Append("<CENTER>");
this.page.Response.Clear();
this.page.Response.AddHeader("content-disposition","attachment;filename=StationData.htm");
this.page.Response.Charset = "";
this.page.Response.ContentType = "application/vnd.html";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
this.page.Response.Write(str.ToString());
this.page.Response.End();
Posted

1 solution

use Window.Open from javascript and then call the handler which give you the response you created.

[Rose]

 
Share this answer
 


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900