If you need to return xml content from an MVC controller, the easiest way to do it is to use the “Controller.Content” method.
public class TestController : Controller
{
public ActionResult Index()
{
string result = “<books><book/></books>”
return this.Content(result, "text/xml");
}
}
No comments:
Post a Comment