custom-action-filter

OutputCache and recording unique views?

Hi folks, Image i have a view that is cached with the OutputCache attribute but i still need to increment a counter that records that the page has been viewed, how could i do it? I thought about creating my own Custom ActionFilterAttribute, and using Action Filter Order of Execution to record this .. but i'm not sure it will work. eg....

ASP.NET MVC - CustomeAuthorize filter action using an external website for loggin in the user

I have a CustomeAuthorize action filter that forwards the user to signin page if user is not authenticated. I apply this filter to actions or controllers. [CustumeAuthorize] public ActionResult MyAction() { //do something here return View(); } and the filter looks like this: public class CustomAuthorizeAttribute : ActionFilter...

Asp.net mvc - Accessing view Model from a custom Action filter

I am trying to access the Model data passed to the view in the action filter OnActionExecuted. Does anyone know if this is possible? I am trying to do something like this: public override void OnActionExecuted(ActionExecutedContext filterContext) { //get model data //... sitemap.SetCurrentNode(model.Name); } Any advice? ...

ASP.NET MVC: Custom parameters to login page after authorization

I would like to redirect visitors to a login page with added parameters (based on the action they are performing) after the authorization fails. This is an example of what I would like to do: http://stackoverflow.com/questions/835672/asp-net-mvc-customeauthorize-filter-action-using-an-external-website-for-loggin However, since this is...

IAuthorizationFilter + Ninject2

I'm currently using Ninject2 to bind the various services and repositories in my MVC app. That part seems to be working just fine. Now I'd like to also bind my own class to IAuthorizationFilter and all actions that have the attribute set. I've created a class that inherits from AuthorizationFilter and Implements IAuthorizationFilter. ...