gpt4 book ai didi

asp.net-mvc - ASP.NET MVC : in the ActionFilterAttribute class, OnActionExecuted 和 OnResultExecuted 有什么区别?

转载 作者:行者123 更新时间:2023-12-04 14:42:29 25 4
gpt4 key购买 nike

ASP.NET MVC:在ActionFilterAttribute类中,OnActionExecuted和OnResultExecuted有什么区别?实现压缩过滤器时,压缩代码应该放在哪些方法中?

最佳答案

有人提供了您可能会觉得有用的东西 - 看看这个:
http://nraykov.wordpress.com/2009/12/02/asp-net-mvc-custom-compression-action-filter/

OnActionExecuted 在操作执行后发生。我相信这将是控制离开方法的时候。返回的操作结果随后在操作方法之后执行。例如,一个 View 不会在该方法中处理,即使它作为“return View();”返回也是如此。 - 它实际上是在 action 方法返回之后处理的。
OnResultExecuted发生在返回值(即actionresult)已经被执行的时候。

关于asp.net-mvc - ASP.NET MVC : in the ActionFilterAttribute class, OnActionExecuted 和 OnResultExecuted 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6260954/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com