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

  • Home
  • SEARCH
  • 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 8692211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:16:27+00:00 2026-06-13T00:16:27+00:00

I use custom action filter in asp.net mvc app to return http status code

  • 0

I use custom action filter in asp.net mvc app to return http status code 422 and json list of validation errors (basically serialized model state dictionary) to client, where I handle that with global ajaxError handler in jQuery.

All of this works on development enviroment, but my problem is when custom errors mode is on (<system.webServer>/<httpErrors errorMode="Custom">), IIS replaces response (json) with text “The custom error module does not recognize this error.”

I’m having hard time properly configuring IIS to pass-through original response if status code is 422. Anyone did something similar?

  • 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-13T00:16:28+00:00Added an answer on June 13, 2026 at 12:16 am

    If web server is configured to pass through existing response, it will return json contents to browser.

    <system.webServer>
      <httpErrors errorMode="DetailedLocalOnly" existingResponse="PassThrough">
      </httpErrors>
    </system.webServer>
    

    MSDN: httpErrors Element [IIS Settings Schema]

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

Sidebar

Related Questions

To use custom layout file in my app I'm using this following code, set
I am working on an ASP.Net Mvc 3 application using FormsAuthentication with a custom
I want to use custom action filter to manipulate parameters to one action. User
I've created a custom filter for my MVC application, [LogAttribute] . Action methods are
I successfully deploy my custom Action to the list of Actions available for use
I have a custom Principal/Identity for my ASP.NET MVC4 web app. I have also
I have an ASP.NET MVC 2 application which in part allows a user to
I am using asp.net mvc 1.0. I know asp.net mvc has a couple attribute
I'm setting some RouteData inside a custom Action Filter filterContext.RouteData.Values.Add(accountId, accountId); filterContext.RouteData.Values.Add(permission, (int)permission); Then
I created a custom Action Filter with no problem. But I would like to

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.