Solved

ASP.Net  Response.OutputStream to a new window

Posted on 2014-01-29
4
662 Views
Last Modified: 2014-01-31
Hi..
I'm outputting a report to the current window like this.. works fine.
But the back button etc are disabled
How can Output to a new window or popup?
thx

   Response.Clear();
            Response.ContentType = "message/rfc822";
            Response.Cache.SetCacheability(HttpCacheability.Private);
            Response.Expires = -1;
            Response.Buffer = false;
            Response.OutputStream.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
            Response.End();
0
Comment
Question by:JElster
  • 2
  • 2
4 Comments
 
LVL 21

Expert Comment

by:Craig Wagner
ID: 39819543
The server can't open a new browser window. You'll need to open a new window using JavaScript and set the URL of the new window to be the endpoint that executes the code that returns the report.
0
 
LVL 1

Author Comment

by:JElster
ID: 39819734
Ok.. If I open a window in JS. How can write the response (to the window)
0
 
LVL 1

Author Comment

by:JElster
ID: 39824469
I've requested that this question be closed as follows:

Accepted answer: 0 points for JElster's comment #a39819734

for the following reason:

no answer
0
 
LVL 21

Accepted Solution

by:
Craig Wagner earned 500 total points
ID: 39824423
How can write the response (to the window)

By doing what I told you to do in the original message I wrote, i.e.

set the URL of the new window to be the endpoint that executes the code that returns the report.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

827 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question