ASP.NET MVC XML Action Result

For my Location Service in F# I needed a way to be able to return XML from MVC (which powers my site), but I couldn’t find a way to do this out of the box with XML.
Luckily creating your very own ActionResult is really quite easy in MVC.
First yo…


This content originally appeared on Posts on LINQ to Fail and was authored by Posts on LINQ to Fail

For my Location Service in F# I needed a way to be able to return XML from MVC (which powers my site), but I couldn’t find a way to do this out of the box with XML. Luckily creating your very own ActionResult is really quite easy in MVC. First you need to implement the ActionResult class: public class XmlActionResult : ActionResult { public override void ExecuteResult(ControllerContext context) { } } I’m going to add a couple of public properties:


This content originally appeared on Posts on LINQ to Fail and was authored by Posts on LINQ to Fail


Print Share Comment Cite Upload Translate
APA
Posts on LINQ to Fail | Sciencx (2023-02-04T23:30:56+00:00) » ASP.NET MVC XML Action Result. Retrieved from https://www.scien.cx/2010/06/16/asp-net-mvc-xml-action-result/.
MLA
" » ASP.NET MVC XML Action Result." Posts on LINQ to Fail | Sciencx - Wednesday June 16, 2010, https://www.scien.cx/2010/06/16/asp-net-mvc-xml-action-result/
HARVARD
Posts on LINQ to Fail | Sciencx Wednesday June 16, 2010 » ASP.NET MVC XML Action Result., viewed 2023-02-04T23:30:56+00:00,<https://www.scien.cx/2010/06/16/asp-net-mvc-xml-action-result/>
VANCOUVER
Posts on LINQ to Fail | Sciencx - » ASP.NET MVC XML Action Result. [Internet]. [Accessed 2023-02-04T23:30:56+00:00]. Available from: https://www.scien.cx/2010/06/16/asp-net-mvc-xml-action-result/
CHICAGO
" » ASP.NET MVC XML Action Result." Posts on LINQ to Fail | Sciencx - Accessed 2023-02-04T23:30:56+00:00. https://www.scien.cx/2010/06/16/asp-net-mvc-xml-action-result/
IEEE
" » ASP.NET MVC XML Action Result." Posts on LINQ to Fail | Sciencx [Online]. Available: https://www.scien.cx/2010/06/16/asp-net-mvc-xml-action-result/. [Accessed: 2023-02-04T23:30:56+00:00]
rf:citation
» ASP.NET MVC XML Action Result | Posts on LINQ to Fail | Sciencx | https://www.scien.cx/2010/06/16/asp-net-mvc-xml-action-result/ | 2023-02-04T23:30:56+00:00
https://github.com/addpipe/simple-recorderjs-demo