PDA

View Full Version : static xml file is binding but xlm from ashx is not



realnus
17 Jan 2010, 1:38 PM
Hello ,
I have just started using Extjs . Everything seemed fine until I used a ashx request for grid.
I can run the example from localhost below.
http://www.extjs.com/deploy/dev/examples/grid/array-grid.html

but when I change the line
url: 'http://localhost/js/examples/grid/sheldon.xml'
to
url: 'http://localhost/ashx/xml.ashx'
I get the response as xml but grid doesn't bind the xml data to grid. http://localhost/ashx/xml.ashx page gets the physical file sheldon.xml and writes the response.So I am sure that xml format is fine and data comes fine as response (also checked with firebug)

What am I missing ?

Thanks ...

realnus
18 Jan 2010, 8:21 AM
Coluld you please help me about this situation ?

stdunbar
18 Jan 2010, 11:03 AM
I can't see from your attached image - what is the Content-Type coming back from the server? It must be "text/xml" or "application/xml" for the XmlReader to handle it correctly.

realnus
18 Jan 2010, 11:38 AM
Thanks stdunbar,
It works fine now. I had forgotton to add the line to ashx file :D
context.Response.ContentType = "text/xml";