Render webpage with attachment

  • Thread starter Thread starter William F. Robertson, Jr.
  • Start date Start date
W

William F. Robertson, Jr.

I am trying to render out a full webpage, but have an attachment with the
page that will open.

Here is the code I am using the send the file.
Response.ClearHeaders();
Response.AddHeader( "Content-Disposition", "attachment;
filename=apdetails.csv" );
Response.ContentType = "text/csv";
Response.BinaryWrite( bytes );

Is there anything I can add to the headers that will stop this attachment so
I can continue sending the regular webpage?

I tried setting the content type back to text/html, but that did nothing
except append the html to the end of my csv file.

TIA,
bill
 
Your reply cant be two things- it can either be a reponse made up of
html/text or a binary stream which is a file type. Browsers dont understand
mulit-part mixed types

If you need to send two types, send the text with javascript to open a
window with your file, or have it as an iframe in your text response

--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP
 
Back
Top