<分区>
Possible Duplicate:
What is the best way to return XML from a controller's action in ASP.NET MVC?
我能够将 JSON 和部分 View (html) 作为有效的 ActionResult 返回,但如何返回 XML 字符串?
<分区>
Possible Duplicate:
What is the best way to return XML from a controller's action in ASP.NET MVC?
我能够将 JSON 和部分 View (html) 作为有效的 ActionResult 返回,但如何返回 XML 字符串?
最佳答案
您可以使用 return this.Content(xmlString, "text/xml");
从操作返回构建的 XML 字符串。
关于.net - 如何在 MVC 中返回 XML 字符串作为操作结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/878695/