action-filter
When should we implement a custom MVC ActionFilter?
Should we move logic that supposes to be in Controller (like the data to render the partial view) to ActionFilter?[详细]
2023-03-22 01:14 分类:问答Why does this code return "Specified method is not supported."
Why does this code return \"Specified method is not supported.\" using System; using System.IO; using System.Security.Cryptography;[详细]
2023-03-19 06:11 分类:问答How can I use data placed into a ViewBag by a filter in my Error.cshtml view?
I have an action filter that is responsible for placing some common information into the ViewBag for use by all views in the shared _Layout.cshtml file.[详细]
2023-03-17 15:28 分类:问答How to handle Session timeout in MVC 3
I am having issues with frequent Session Time Out. I want to write a common filter that I could use on each controller, filter should redirect the use开发者_JS百科r to login and after log in back to[详细]
2023-03-16 22:33 分类:问答Why call base.OnActionExecuting(filterContext);?
I am just looking at some old code of mine 开发者_JAVA百科and I have an action filter(OnActionExecuting method)[详细]
2023-03-13 18:49 分类:问答FilterAttributes conflicting Compress, RegexFilter
I have a controller action like so [AcceptVerbs(HttpVerbs.Get | HttpVerbs.Put)] [InsertScript(Order = 1)][详细]
2023-03-11 08:18 分类:问答Use cached data on an action filter, to avoid another execution of an action
I would like to do the following (i will split in two points): Before execution of the action, if the viewmodel is in cache then return the view and the viewmodel without execute the action.[详细]
2023-03-10 16:17 分类:问答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 分类:问答Order property of ActionFilter, from lowest to greatest or vice versa?
I defined two ActionFilters: [DefaultResources(Order = 2)] [RenderTemplate(Order = 1)] And to my surprise DefaultResources is executed BEFORE RenderTemplate. But according to MSDN documentation it[详细]
2023-03-09 05:12 分类:问答Injecting dependency into CustomAttribute using Castle Windsor
In my ASP.Net MVC application I have implemented a Custom ActionFilter to Authorize users. I use CastleWindsor to provide dependency injection into all of the controllers as foll开发者_开发问答ows:[详细]
2023-03-08 18:49 分类:问答