Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9215733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:16:09+00:00 2026-06-18T02:16:09+00:00

I have 2 action filter: [Auth] [Check] public ActionResult Home() { //… } I

  • 0

I have 2 action filter:

[Auth]
[Check]
public ActionResult Home()
{
//...
}

I need set CheckAttr first work and break AuthAttr.

I do not remember how to do it. Please help me.

example:

request to action Home -> first work Auth filter and logic I need redirect to another action

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T02:16:10+00:00Added an answer on June 18, 2026 at 2:16 am

    You could short-circuit the entire execution by setting the Result property of the filterContext:

    public override void OnActionExecuting(ActionExecutingContext filterContext)
    {
        filterContext.Result = new JsonResult
        {
            Data = "hello",
            JsonRequestBehavior = JsonRequestBehavior.AllowGet
        };
    }
    

    In this example I have returned a JsonResult but you could return any ActionResult you like: ViewResult, PartialViewResult, RedirectToRouteResult, …

    Once you assign the Result property no more filters will be executed for this context. The action execution itself will be short-circuited as well.

    Also bear in mind that if your action filters are deriving from the same type there are no guarantees in which order they will be executed unless you manually assign the Order property on each of them. Of course if they are of different types such as IAuthorizationFilter or IActionFilter, it is obvious that authorization filters will run before any action filters. That’s by design.

    If on the other hand you are only attempting to prevent other action filters from executing but the action itself should execute, I am afraid that there’s no way to achieve that and you will have to rethink your design of those filters.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's have a action filter where I'm accessing the httpcontext in two ways. public
Is there a way to have an action filter, like public class MyActionFilterAttribute :
I have an action that looks like this: [Post] [PopulateModelFromId] public ActionResult ChangeName( string
I have an action filter attribute on my BaseController class: <CompressFilter()> _ Public Class
I have this custom action filter: public class PermissionChecker: ActionFilterAttribute { private int _permissionId
I have a custom validation attribute derived from action filter attribute. Currently the attribute
I have two custom ActionFilters on an action. In first of the actionfilters, I
MVC 4 I have an action filter that I want applied only to the
I have an action filter checks whether or not a session variable ID is
I have an action filter which i got from the below link http://blog.wekeroad.com/blog/aspnet-mvc-securing-your-controller-actions/ there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.