Click here to Skip to main content
15,914,400 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionurgent Pin
dews turner24-Oct-07 18:35
dews turner24-Oct-07 18:35 
AnswerRe: urgent Pin
N a v a n e e t h24-Oct-07 20:26
N a v a n e e t h24-Oct-07 20:26 
GeneralRe: urgent Pin
dews turner24-Oct-07 22:31
dews turner24-Oct-07 22:31 
AnswerRe: urgent Pin
PandemoniumPasha24-Oct-07 20:38
PandemoniumPasha24-Oct-07 20:38 
AnswerRe: urgent Pin
Christian Graus24-Oct-07 20:54
protectorChristian Graus24-Oct-07 20:54 
Questionreset query string Pin
jensenx24-Oct-07 17:11
jensenx24-Oct-07 17:11 
AnswerRe: reset query string Pin
N a v a n e e t h24-Oct-07 20:19
N a v a n e e t h24-Oct-07 20:19 
QuestionPerforming the equivalent of two response.X functions in the same click event Pin
_Damian S_24-Oct-07 16:39
professional_Damian S_24-Oct-07 16:39 
Hi Guys/Girls,

Have been beating my head against the wall over this one for a while, and have come to the conclusion that I have probably just overlooked something simple. I am happy to look at alternative methods to open the popup page, but would prefer to keep the existing method for the download of the file.

Here's the situation:

In the on-click event of a button I do some processing, then want to do two things (in no particular order)

1. Pop up a window that opens a page that displays a crystal report as a PDF (this page exists and works fine in its own right)

2. Download a file. (this function also works fine in its own right)

Here's the rub:

Currently, I use response.write to trigger the page popup like this:

Response.Write("<script language=javascript>window.open('pagename.aspx?ReportID=49&Param1=" & intParam1 & "','new_Win');</script>")

(I can't attach it to the link attributes as the param1 needs to be generated by the processing in the existing on click code.)

Then, I use functions that end up calling the following code to download the file:
<preprocessing happens here>
With Response
.AddHeader("Content-disposition", "attachment;filename=" & strFriendlyName)
.ContentType = "application/octet-stream"
.BinaryWrite(btFile)
.End()

End With


Naturally, with the code as it stands the system throws a hissy-fit as you can't use two responses for the one page (by design). Surely there is some way for me to open the crystal report/pdf viewing page in code without using the response.write or response.redirect, that will allow for the processing of the rest of the code (and hence the downloading of the file)???

As I said, I have probably missed something incredibly simple, and you ASP.NET gurus are going to go "silly bugger, why don't you just open the popup by using XYZ"... I am prepared to wear that!

Thanks in advance...

D.

-------------------------------------------
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Just bugger off and leave me alone!!

AnswerRe: Performing the equivalent of two response.X functions in the same click event Pin
Guffa29-Oct-07 14:20
Guffa29-Oct-07 14:20 
GeneralRe: Performing the equivalent of two response.X functions in the same click event Pin
_Damian S_29-Oct-07 14:30
professional_Damian S_29-Oct-07 14:30 
AnswerRe: Performing the equivalent of two response.X functions in the same click event Pin
Guffa30-Oct-07 4:25
Guffa30-Oct-07 4:25 
GeneralRe: Performing the equivalent of two response.X functions in the same click event Pin
_Damian S_30-Oct-07 20:17
professional_Damian S_30-Oct-07 20:17 
QuestionJavaScript Not Running Pin
kenexcelon24-Oct-07 13:20
kenexcelon24-Oct-07 13:20 
AnswerRe: JavaScript Not Running Pin
Christian Graus24-Oct-07 13:26
protectorChristian Graus24-Oct-07 13:26 
QuestionKeep DAta uptdated Pin
crazy friend24-Oct-07 12:18
crazy friend24-Oct-07 12:18 
AnswerRe: Keep DAta uptdated [modified] Pin
Pete O'Hanlon25-Oct-07 2:57
mvePete O'Hanlon25-Oct-07 2:57 
Questionhow to use timer control in ASP.NET 2005 Pin
joshi reddy podduturi24-Oct-07 10:15
joshi reddy podduturi24-Oct-07 10:15 
AnswerRe: how to use timer control in ASP.NET 2005 Pin
crazy friend24-Oct-07 12:34
crazy friend24-Oct-07 12:34 
GeneralRe: how to use timer control in ASP.NET 2005 Pin
joshi reddy podduturi24-Oct-07 16:32
joshi reddy podduturi24-Oct-07 16:32 
GeneralRe: how to use timer control in ASP.NET 2005 Pin
Christian Graus24-Oct-07 20:51
protectorChristian Graus24-Oct-07 20:51 
AnswerRe: how to use timer control in ASP.NET 2005 Pin
Christian Graus24-Oct-07 13:00
protectorChristian Graus24-Oct-07 13:00 
GeneralRe: how to use timer control in ASP.NET 2005 Pin
Not Active24-Oct-07 14:39
mentorNot Active24-Oct-07 14:39 
GeneralRe: how to use timer control in ASP.NET 2005 Pin
Christian Graus24-Oct-07 20:48
protectorChristian Graus24-Oct-07 20:48 
Questionabout .net Pin
mirchi_tikhi24-Oct-07 9:13
mirchi_tikhi24-Oct-07 9:13 
AnswerRe: about .net Pin
Deepak Nigam24-Oct-07 9:50
Deepak Nigam24-Oct-07 9:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.