That's right. My apologies. While the content-type is correct for any type
of binary file stream, the file name is not identified, and therefore, the
browser can't identify the file.
The problem here is that the MIME type for an Excel Spreadsheet might or
might not be recognized by the browser. A browser can identify a file type
by either of 2 things: content-type header, and file name. Since the file
has a .aspx extension, the browser can't know what the type is from the
extension.
What I omitted was the Content-Dispostion header, which indicates the name
of the file. The following article details how to do this:
http://www.dotnetspider.com/technology/kbpages/553.aspx
The salient code in the article is as follows:
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "Filename=Requirements.doc" );
Of course, in your case, it would be the file name with an "xls" extension.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Who is Mighty Abbott?
A twin turret scalawag.
"Henrry Pires" <Nelson@Don'tuse.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
It dosn't work. when I put that it try to download the page (my aspx
page). Stange.
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl... application/octet-stream
--
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
Who is Mighty Abbott?
A twin turret scalawag.
"Henrry Pires" <Nelson@Don'tuse.com> wrote in message
news:ul**************@TK2MSFTNGP09.phx.gbl... Hello to all.
I'm trying to diplay word, exel and pdf documentes inside the ie window.
To show a pdf file i know that i have to set the property ContentType =
"application/pdf". But I was unable to find the value to display exel
files. Does ny one know what correct value to show this kind of values?
Thanks in advance