actionfilterattribute
MVC How to return view in ActionFilterAttribute like ActionResult?
Is it even possible to return a view from an ActionFilterAttribute? Right now i just have it throw an error and in the OnException in the base controller reroutes to an error page. Would liek to show[详细]
2023-04-10 02:25 分类:问答ASP.NET MVC Global or BaseController ActionFilter to Execute Before OnAuthorization
In my application (ASP.NET MVC 3) I have a BaseController class that all my Controllers inherit and in that BaseController I have overridden the OnActionExecuting method to check to ensure a Session v[详细]
2023-04-05 07:49 分类:问答Injecting dependencies into ASP.NET MVC 3 action filters. What's wrong with this approach?
Here\'s the setup. Say I have some action filter that needs an instance of a service: public interface IMyService[详细]
2023-03-30 14:09 分类:问答ActionMethodSelectorAttribute + AllowHtml
I have an ActionMethodSelectorAttribute which i have the following line in: var req = controllerContext.RequestContext.HttpContext.Request.Form.AllKeys.Any() ? controllerContext.RequestContext.HttpC[详细]
2023-03-22 05:20 分类:问答ASP.net MVC Global Filtering
This is sort of a broad question, but one I am curious about. What are some examples of uses for MVC Global filters? I.E.[详细]
2023-03-10 13:58 分类:问答ASP.NET MVC 3 FilterAttribute - setting a variable that will be accessible in the Controller
In a FilterAttribute I am making in MVC3, I want to开发者_开发问答 set a variable that will be accessible inside my Controller.How can I do this?Is it possible?Thank you.You could put your value in th[详细]
2023-02-25 03:13 分类:问答Enforce security check in ASP.NET MVC?
I am implementing a collaborative web gallery, and I have a few roles for each user: Admin DeleteImage DeleteOwnImage[详细]
2023-02-15 10:28 分类:问答Use a IRouteConstraint or ActionFilterAttribute when validating session data against route data
I\'ve been implementing a RouteConstraint recently whos responsibility is to Match a custom route value against some model data that is in the session.[详细]
2023-02-12 13:14 分类:问答ASP.NET MVC3 + ActionFilterAttribute + Injection?
Hey there, I\'ve succesfull been able to use property injection in my FilterAttribute, however I\'m wondering whether its possible to move it into the constructor instead?[详细]
2023-02-07 05:17 分类:问答ASP.NET MVC action filters: Setting the filterContext.Result in a filter prevents other filters from being executed?
I currently have 2 filters, Auth and Redirect that do the following: Filter Auth, who implements IAuthorizationFilter and ActionFilter, checks for user login and authorization, and if that fails sets[详细]
2023-01-22 21:29 分类:问答