If I have a before action filter, how to set properties so they are available in actions?
In my actions, I want to pre-load the User object and set some other properties, all BEFORE the action loads.
I know there are events where I can do this, but how will these objects that I set be made available in my controller's actions once the filter fires and execution is now开发者_JAVA技巧 at the action level?
example:
public actionresult SomeAction() { string username = this.CurrentUser.username;
}
public override OnActionExecuting( forgotthesignature filterContext )
{
this.CurrentUser = whatever;
}
精彩评论