Strange problem

  • Thread starter Thread starter Flurry
  • Start date Start date
F

Flurry

Hello

I've got a problem and I'm not getting much help trying to resolve it.
I've searched google all morning for an answer....

I have the following code:

Lab1.text = "Your Serial Number is: "
Lab2.text = serialNo & "-" & serialYY

Response.Clear()
Response.AddHeader("Content-Disposition", "attachment;
filename=" & fname)
Response.ContentType = "txt, doc, jpg"
Response.WriteFile(path)

which is supposed to output a serial number in two labels and then
download a file. The problem is that when I put the code to download
the file, the serial number is not displayed on the page.

To recap and make sure everything is clear. Without the download code
the labels get set correctly. When I put the download code in, the file
downloads correctly but the labels are never set.

Can someone explain what is going on????

Many thanks...
 
It's a single response...you can't both stream normal html and biarny data
on it. It's a basic http/web thing. It's why if you go visit an image in
your browser, say, http://www.google.com/intl/en/images/logo.gif you'll
never see plain text as well as the image.

One solution might be to load the page, display your 2 labels, and use a
javascript to redirect to downloadSomeFile.aspx downloadSomeFile.aspx
would let the user download the file, while the page would stay where it is
since no new html stream was received.

Karl
 
Back
Top