Displaying text/plain as text in IE with asp.net

M

Mike Bridge

Is there any way to get Internet explorer to treat a text/plain .net
page as plain text using asp.net? It seems like IE doesn't trust
text/plain as a mime type, and so it (ironically) displays it as
text/html. (This works fine in Mozilla, though.)

I thought maybe IE would use the file extension as a guide, but it
doesn't seem to work. I tried mapping the .txt extension in IIS so it
is parsed by the .net framework, then setting up an HttpModule to map
calls to http://.../MyApp/Test.txt to Test.aspx. The mapping works
fine, but it still displays my plain text as HTML.

Is there another way to generate a plain text page for IE in asp.net?

Thanks,

-Mike
 
M

Mike Bridge

Hi-

Unfortunately, setting the ContentType to text/plain doesn't doesn't
have any effect---it still displays as "text/html". Internet Explorer
designates that all documents with "text/plain" content-types are
"ambiguous" and so it applies some other tests to try to guess what it
is:


http://msdn.microsoft.com/library/d...op/networking/moniker/overview/appendix_a.asp

As far as I can tell, when you designate your page as plain text, the
only thing you can be sure of is that it will not be rendered in IE as
plain text.

-Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top