XML Content Type
am 27.07.2007 16:22:02 von Jim
Does anyone know why Response.AddHeader "Refresh" does not work when
Response.ContentType = "text/xml"?
The code is very short:
<%
Response.ContentType = "text/xml"
Response.AddHeader "Refresh", "5;URL=http://localhost/ReturnXML2.asp"
%>
-1
-1
125
23
Hex GUID goes here
The XYZ Company
If I change the contentType to "text/plain", the page does refresh/redirect
but not when the ContentType is XML. It needs to be in XML for Cisco Call
Manager.
There is documentation out there that makes it seem like executing the above
code is no problem but I can't get it to refresh/redirect. Can anyone shed
any light?
Re: XML Content Type
am 27.07.2007 16:52:47 von Anthony Jones
"Jim" wrote in message
news:E9F9D5B5-81DD-46C2-8B48-0EBF51EA0366@microsoft.com...
> Does anyone know why Response.AddHeader "Refresh" does not work when
> Response.ContentType = "text/xml"?
>
> The code is very short:
> <%
> Response.ContentType = "text/xml"
> Response.AddHeader "Refresh", "5;URL=http://localhost/ReturnXML2.asp"
> %>
>
> -1
> -1
> 125
> 23
> Hex GUID goes here
> The XYZ Company
>
>
> If I change the contentType to "text/plain", the page does
refresh/redirect
> but not when the ContentType is XML. It needs to be in XML for Cisco Call
> Manager.
>
> There is documentation out there that makes it seem like executing the
above
> code is no problem but I can't get it to refresh/redirect. Can anyone shed
> any light?
>
The refresh header is a directive to the HTML browser (that browsers aren't
obligated to implement) it isn't a header defined by the HTTP protocol.
When using text/plain the browser assumes responsibility for rendering the
content (IE treats it as HTML). Since the content it is rendering has a
refresh header attached it puts it into action.
However when the content is text/xml the browser isn't actually rendering
the XML. It uses the
document to transform the XML to content it should render. If that PI isn't
present is uses a default transform. After the transform the content it is
actually rendering no long has a refresh header associated with it so
nothing happens.
Cisco call manager that consumes your XML content would have to be coded to
honor the refresh header.
--
Anthony Jones - MVP ASP/ASP.NET