asp.net-mvc – 如何在ActionFilterAttribute ASP MVC 5中为ViewBag设置值?
您好,我想为我的应用程序中的每个控制器创建自定义ActionFilterAttribute,此属性应该设置一些ViewBag值. ActionFilterAttribute是否适合它,以及如何在ActionFilterAttribute中访问viewbag? 你可以这样做 public class SomeMsgAttribute : FilterAttribute, IResultFilter