I trying to return a ViewResult in OnActionExecuted method override from ActionFilterAttribute class
Like below ...
public override void OnActionExecuted(ActionExecutedContext filterContext)
{
if (CreateCookie && filterContext.Exception == null)
{
LoginCookies lcookie = new LoginCookies(usuDs, usuSenha);
lcookie.WriteCookie("SCE", 10);
}
else
{
filterContext.Result = new ViewResult() { ViewName = "Login" };
filterContext.Result.ExecuteResult
(filterContext.Controller.ControllerContext);
}
It works fine to return to a view called "Login",but i need to pass the model object to this view (in this case model object is type of Users) and I don't know how to pass it using ViewResult class directly.
Any ideas?
UPDATED:
I've solved my problem setting filterContext.ExceptionHandled to TRUE,but the main problem was not solved, I can't set Model property of View, it is always null.