Reputation: 33948
I have the following code which uses the new MVC3 HttpStatusCodeResult:
protected override void OnActionExecuted(ActionExecutedContext filterContext) {
base.OnActionExecuted(filterContext);
filterContext.Result = new HttpStatusCodeResult(304, "Not Modified");
}
I am still getting a 200OK and I can't figure out why. Please advise.
Upvotes: 1
Views: 868
Reputation: 1039598
Works for me:
public class HomeController : Controller
{
protected override void OnActionExecuted(ActionExecutedContext filterContext)
{
base.OnActionExecuted(filterContext);
filterContext.Result = new HttpStatusCodeResult(304, "Not Modified");
}
public ActionResult Index()
{
return View();
}
}
And the result is what we would expect:
Upvotes: 7