473,568 Members | 2,935 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1771
Hi Mike,
use , Response.Conten tType="text/plain"; in your code..
HTH
Regards,
Marshal Antony
..NET Developer
http://www.dotnetmarshal.com


"Mike Bridge" <mi**@bridgecan ada.com> wrote in message
news:8r******** *************** *********@4ax.c om...
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.Conten tType="text/plain"; in your code..
HTH
Regards,
Marshal Antony
.NET Developer
http://www.dotnetmarshal.com


"Mike Bridge" <mi**@bridgecan ada.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
3408
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 image, it does build up the image gradually until it's almost finished, but then the partly visible image is replaced by the error message/error box...
3
1165
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 slashes disappear. Is there a special method of pulling slahes into asp? Thanks, Yuval
9
5532
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 shell pieces like this: <pre><code> #!/bin/sh ftp -i -n ftp.server.com&lt; &lt;EOF user username password epsv4 cd /
4
2404
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. When processing an email which contains UTF8 encoded characters, I can't work out how to detect the presence of the UTF8 characters, so I get =E2=80=99...
12
2322
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: <meta http-equiv="Content-Type" content="text/html; charset=windows-1251"> Will this work for javascript alerts also?
5
2806
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). Is there a way to display the content of xmlhttp.responseText on a new page?? I tried document.write(xmlhttp.responseText) but this does not...
6
1961
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 a little but I can't seem to get it to work. It attaches the file properly, but only displays the Plain Text message, even in an HTML-capable...
2
2354
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 (Internet Explorer). It displays something like $^^% instead of a comma. Please how can I have the browser display the comma as it is from the...
1
4185
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 aligned to the top, along with the slideshow and link buttons, you have to scroll down to see the text - how can I make IE6 display correctly? ...
0
7693
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7605
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8118
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7665
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2105
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.