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 3318082
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:39:49+00:00 2026-05-17T22:39:49+00:00

I currently have 2 filters, Auth and Redirect that do the following: Filter Auth,

  • 0

I currently have 2 filters, Auth and Redirect that do the following: Filter Auth, who implements IAuthorizationFilter and ActionFilter, checks for user login and authorization, and if that fails sets the filterContext.Result to be a HttpStatusCodeResult of 403 (forbidden). Filter Redirect, who implements IActionFilter and ActionFilter, checks the Result and if it’s a 403, redirects to a login page.

I have them applied to an action as follows:

[Auth(Order=0)]
[Redirect(Order=1)]

However, Auth gets executed but Redirect never gets executed (not one of the 4 overrideable methods it provides). If I remove Auth Redirect gets executed, but if I include Auth as the first filter, Redirect isn’t executed. I guess that setting the Result property of the filter context prevents any other filters from getting executed, but I can’t realiza why this happens. FYI I’m using ASP.NET MVC 3 beta, but that shouldn’t change anything.

Update: Changing the filter type of Auth to IActionFilter instead of IAuthorizationFilter causes the OnResultExecuting and OnResultExecuted in Redirect to fire, but changing the Response there has no effect whatsoever on the final response to the browser.

  • 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-05-17T22:39:50+00:00Added an answer on May 17, 2026 at 10:39 pm

    I ended up fixing it by making Redirect a IResultFilter and writing the following in OnResultExecuting:

    filterContext.HttpContext.Response.Redirect(url);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Rails 2.3.x app that implements the act_as_authentic in User model and
I currently have div classes for filters that cannot be changed. I want to
Is it possible to combine Underscore's filter and map? I currently have two separate
I have a custom validation attribute derived from action filter attribute. Currently the attribute
I currently have the following table definition: <table border=1 cellspacing=0 bordercolor=#CEDFEF cellpadding=1> I am
I currently have a MySQL database that I am accessing using PHP. You search
I currently have the below code, but obviously I am not that skilled on
I have a model that looks like this: from django.db import models from django.contrib.auth.models
I currently have 2000 records in a postgresql database being updated every minute that
I have a site that displays a list of articles, along with category filters.

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.