[英]OnActionExecuted: no suitable method found to override
我收到一个error
OnActionExecuted:找不到适合的方法来覆盖
public override void OnActionExecuted(ActionExecutingContext filterContext)
{
filterContext.HttpContext.Response.Cache.SetCacheability(HttpCacheability.NoCache);
filterContext.HttpContext.Response.Cache.SetNoStore();
}
我想在方法执行后执行此代码。
这是方法签名:
protected virtual void OnActionExecuted (System.Web.Mvc.ActionExecutedContext filterContext);
您的替代中参数类型错误。 它期望类型为ActionExecutedContext
的参数而不是ActionExecutingContext
。 参见OnActionExecuted
它应该是:
public override void OnActionExecuted(ActionExecutedContext filterContext)
{
// code goes here
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.