I\'m developing an website which is to be viewed on mobile (cellphone) devices. I\'m just using plain HTML 4.01, nothing special at all. The pages render fine on all the mob
Turns out I hadn't implemented the ActionFilter correctly.. I needed to override the OnResultExecuted method in addition to the OnActionExecuted method. The full attribute looks like this (just add [HtmlOverrideFilter] to your Controllers where needed). Hope this helps someone.
internal class HtmlOverrideFilter : ActionFilterAttribute
{
public override void OnActionExecuted(ActionExecutedContext filterContext)
{
filterContext.HttpContext.Response.ContentType = "text/html";
}
public override void OnResultExecuted(ResultExecutedContext filterContext)
{
filterContext.HttpContext.Response.ContentType = "text/html";
}
}