Jim Mitchell wrote:
I tried the following to return an XML string, but it did not seem to return
XML
Any ideas?
Thanks in advance.
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Response.ContentType = "text/xml"
Response.Write("<ReturnValue><GoodLogin>False</GoodLogin></ReturnValue>")
end sub
When I write a little C# example
<%@ Page Language="C#" %>
<script runat="server">
void Page_Load (object sender, System.EventArgs evt) {
Response.ContentType = "text/xml";
Response.Write("<gods><god name=\"Kibo\" /></gods>");
}
</script>
and load the page with Mozilla 1.4 then it recognizes it is an XML page
and pretty prints the XML structure. Only IE6 tries to be too clever I
think and does its usual content sniffing instead of expecting the
Content-Type header. However, if I use scripting in IE to load the aspx
page then it works e.g. with
var xmlDocument = new ActiveXObject('Msxml2.DOMDocument.4.0');
xmlDocument.async = false;
var loaded = xmlDocument.load('test20030810.aspx');
if (loaded) {
alert(xmlDocument.documentElement.nodeName);
}
the node name of the document element is alerted in a dialog box.
Thus I guess your problem is that IE is not rendering the XML as such. I
am currently clueless on how to achieve that.
--
Martin Honnen
http://JavaScript.FAQTs.com/