Problem with postback after Response.Write
From: Russ (russk2_at_eticomm.net)
Date: 10/06/04
- Next message: Matt Mercer: "Re: repeater advice"
- Previous message: Deepankar Raizada: "Re: Word Documents"
- Next in thread: Patrice: "Re: Problem with postback after Response.Write"
- Reply: Patrice: "Re: Problem with postback after Response.Write"
- Reply: STech: "RE: Problem with postback after Response.Write"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 06 Oct 2004 14:18:28 -0400
My web app writes some binary data to a file at the client site via
Response.Write and Response.BinaryWrite. This action is accomplished
in response to a button click, with C# code behind as follows:
private void SubmitButton_Click (object sender, System.EventArgs e)
{
// Set up the response to write the print file to the client
Response.Clear ();
Response.AppendHeader ("Content-Disposition",
"filename=WebPrint.prn");
Response.ContentType = "application/octet-stream";
int len = CalcLength ()
Response.AppendHeader ("Content-Length", len.ToString ());
Response.Write (s); // Write some string data
Response.BinaryWrite (buf); // Write binary data
Response.End ();
}
This works fine. But my problem is that after the browser puts up the
File Download box and the user saves the file, the page does not get
posted back. After the file is downloaded I need to transfer control
to another page, and I can find no way to do it.
I've tried replacing Response.End with Response.Redirect with no
effect. Adding Server.Transfer after Response.End, or even in place
of it has no effect - I can trace the code and the function is called,
but the page is never posted back so the action does not happen.
Help???
Thanks, Russ
- Next message: Matt Mercer: "Re: repeater advice"
- Previous message: Deepankar Raizada: "Re: Word Documents"
- Next in thread: Patrice: "Re: Problem with postback after Response.Write"
- Reply: Patrice: "Re: Problem with postback after Response.Write"
- Reply: STech: "RE: Problem with postback after Response.Write"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|