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

From: Marshal Antony (dotnetmarshal_at_yahoo.com)
Date: 02/20/04


Date: Fri, 20 Feb 2004 01:12:01 -0600

Hi Mike,
use , Response.ContentType="text/plain"; in your code..
HTH
Regards,
Marshal Antony
.NET Developer
http://www.dotnetmarshal.com

"Mike Bridge" <mike@bridgecanada.com> wrote in message
news:8rma30pkime6587g28uvs5vdcabnfag584@4ax.com...
> 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
>


Loading