質問

これは私の古いコードです


    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;
    }
役に立ちましたか?

解決

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

他のヒント

FYI、RC1現在、次のようにしています:

filterContext.ActionDescriptor.ActionName
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top