R
Russ
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
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