Pregunta

este es mi antiguo código


    protected override bool OnPreAction(string actionName, System.Reflection.MethodInfo methodInfo)
    {
        if ("|Register|RegisterPage|Login|LoginPage|Logout|Service".ToLower().Contains(actionName.ToLower()))
        {
            return base.OnPreAction(actionName, methodInfo);
        }

        Customer = CustomerHelper.GetCustomer();

        if (Customer.IsSeccessedLogin())
        {
            return base.OnPreAction(actionName, methodInfo);
        }

        Response.Redirect("Login.html");
        return false;
    }
¿Fue útil?

Solución

string actionName = (string)filterContext.RouteData.Values["action"];

Otros consejos

Para tu información, a partir de RC1, hazlo así:

filterContext.ActionDescriptor.ActionName
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top