PDA

View Full Version : [CLOSED] Returning XML from an AJAX call to a store



craig2005
Jun 05, 2012, 9:01 PM
I was looking at this grid example:

http://examples2.ext.net/#/GridPanel/Commands/Image_Command/
(http://examples2.ext.net/#/GridPanel/Commands/Image_Command/)

I've got everything working, but when I return the same XML, like in this example, it doesn't work. Using MVC, how should I be returning this XML. I copied the XML from the response in the XHR call in the example.

http://examples2.ext.net/Examples/GridPanel/Shared/PlantService.asmx/Plants?_dc=1338905203998

I see that StoreResult and AjaxResult just convert to JSON. I tried returning as a string, but that didn't work either.

I'm really just asking if there is an Ext.net 2.0 way to do it. I know I can find a class like below. I'm just wondering if there is a better way.

http://stackoverflow.com/questions/134905/what-is-the-best-way-to-return-xml-from-a-controllers-action-in-asp-net-mvc

Daniil
Jun 05, 2012, 9:28 PM
Hi,

I think you should use XmlResult.
http://forums.ext.net/showthread.php?18509

craig2005
Jun 06, 2012, 2:26 PM
Hi,

I think you should use XmlResult.
http://forums.ext.net/showthread.php?18509

already implemented that in the link i attached to the previous post. Just wondering if there was a built in Ext.Net method I didn't know about.

thanks.

Daniil
Jun 06, 2012, 3:13 PM
Ok, got it.

There is no any special thing in Ext.NET to deal with XML. Using XmlResult appears to be the best choice.

Another approach could be a ContentResult with a respective Content-Type.

craig2005
Jun 06, 2012, 4:10 PM
ok, thanks!