Hi I'm trying to return a view that is xml, meaning the content type will be "text/xml", and the view is using ASP.NET MVC razor. Another post ASP.NET MVC and text/xml content type showed how to do it with aspx view. How do I get the same done with razor?
If you prefer you can instead make the content type change from your view action, like so:
public ActionResult MyAction() {
Response.ContentType = "text/xml";
return View();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With