473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

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

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

Nov 18 '05 #1
2 1755
Hi Mike,
use , Response.ContentType="text/plain"; in your code..
HTH
Regards,
Marshal Antony
..NET Developer
http://www.dotnetmarshal.com


"Mike Bridge" <mi**@bridgecanada.com> wrote in message
news:8r********************************@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

Nov 18 '05 #2
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/de...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
On Fri, 20 Feb 2004 01:12:01 -0600, "Marshal Antony"
<do***********@yahoo.com> wrote:
Hi Mike,
use , Response.ContentType="text/plain"; in your code..
HTH
Regards,
Marshal Antony
.NET Developer
http://www.dotnetmarshal.com


"Mike Bridge" <mi**@bridgecanada.com> wrote in message
news:8r********************************@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


Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Xiao Tencas | last post by:
When trying to load a png image in GD, I get the error (Mozilla Firefox) "cannot display image, because it contains errors"; IE just shows an empty 'image-error' box. When loading a large enough...
3
by: Yuval | last post by:
Hi, I'm pulling data into ASP from Sybase IQ. When the data is in the database its displayed correctley: //C://.... When I pull it into an asp page, the formating changes, and a few of my...
9
by: Eric Lindsay | last post by:
I can't figure how to best display little snippets of shell script using <pre>. I just got around to organising to bulk validate some of my web pages, and one of the problems occurs with Bash...
4
by: chris_fieldhouse | last post by:
Hi, I'm almost done with a php driven email filter and automated forwarder, I've tested it out with various emails and ironed out plain text and html. But this final item has me stumped. ...
12
by: korund | last post by:
How to make javascript alert with non-english text displaying correctly on computers where english only is default system & language settings? For web page the solution is just use meta tags:...
5
by: hatsumoto | last post by:
Hello, I create an ActiveXObject("Msxml2.XMLHTTP") from my HTML page to submit (i.e. post) XML to a server. I can see the content of the XML response via javascript alert(xmlhttp.responseText)....
6
by: Karl Groves | last post by:
I'm trying to work out a mail system which can send an attachment as well as an HTML formatted message (and a default plain text version). I found some pretty good code on PHP.net and modified it...
2
by: chike_oji | last post by:
Hello, I am displaying data retrieved from a database as a httpresponse in a webform. I noticed that some characters such as the comma (,), display as special characters in the web browser...
1
by: littlealex | last post by:
IE6 not displaying text correctly - IE 7 & Firefox 3 are fine! Need some help with this as fairly new to CSS! In IE6 the text for the following page doesn't display properly - rather than being...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.