IE showing asp/xhtml code not web page

  • Thread starter Robert Mark Bram
  • Start date
R

Robert Mark Bram

Hi All,

Below are two pages I am testing: xmlTest.asp and basic.htm.

The idea is to have my asp page read display the (x)html page. Later I will
add code in the asp page to edit the contents of the xhtml page.

I am running IIS on Windows XP. I am testing with IE 6.0 and Netscape 7.1.

My problem is this:
When I view basic.htm in IE, I see it as a web page.
When I view xmlTest.asp in IE, I see it as a code!
When I view basic.htm or xmlTest.asp in NS, I view them as web pages..

What is going on here? Why is IE deciding to display code rather than the
web page?

Any advice would be most appreciated!

Rob
:)

=======
xmlTest.asp
=======
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<%
var xmlDocument = Server.CreateObject("Msxml2.DOMDocument.3.0");
xmlDocument.async = false;
xmlDocument.setProperty ("ServerHTTPRequest", true);
var loaded = xmlDocument.load(Server.MapPath("about.htm"));
if (loaded) {
xmlDocument.setProperty("SelectionLanguage", "XPath");
Response.ContentType = "text/xml";
xmlDocument.save(Response);
}
else {
Response.Write("<p>Error loading XML document: " +
xmlDocument.parseError.reason + ".<\/p>");
}
%>



=======
basic.htm
=======
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<h1>Heading</h1>
<p>Body Text</p>
</body>
</html>
 
R

Robert Mark Bram

what abt trying "text/html"

How eminently sensible. It worked!
Thanks for the help Roji!

Rob
:)
 

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

No members online now.

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,782
Latest member
ThomasGex

Latest Threads

Top