I'm trying to change one of my razor MVC5 views to produce a plain text instead of html. I put this:
@{
this.Response.ClearContent();
this.Response.ContentType = "text/plain";
}
in my cshtml file but it's still producing an html. I also tried setting it in the controller:
[AcceptVerbs("GET", "POST", "PUT", "DELETE")]
public ActionResult Version()
{
Response.ContentType = "text/plain";
ViewData["ver"] = "v1.1";
return View();
}
Still does not work.
Any ideas?