Doubts relating to error handling in Ajax requests in ASP.net MVC?

I checked the response with the fiddler and it was IIS that was sending default error page for the Server error 500. So it needs to be configured to return "Detailed" response. We can do this using the IIS manager.

Another option that I was following is to define it at application level in application's web. Config file However, I am again in a dilemma whether to go with this approach or to rework my whole application. The problem that occurs is that if there is really some module failing with 500 Internal Server, my code gets exposed in the browser as the errorMode is set to "Detailed".

So I need some way to provide my custom response when I set response error code to 500 and if any other part of application fails (I am not the one setting 500 status code) then the default error page should be sent instead of exposing my code through "Detailed" response. Any help please regards, NIrvan.

I checked the response with the fiddler and it was IIS that was sending default error page for the Server error 500. So it needs to be configured to return "Detailed" response. We can do this using the IIS manager.

Another option that I was following is to define it at application level in application's web. Config file. However, I am again in a dilemma whether to go with this approach or to rework my whole application.

The problem that occurs is that if there is really some module failing with 500 Internal Server, my code gets exposed in the browser as the errorMode is set to "Detailed". So I need some way to provide my custom response when I set response error code to 500 and if any other part of application fails (I am not the one setting 500 status code) then the default error page should be sent instead of exposing my code through "Detailed" response. Any help please.

Regards, NIrvan.

Was the default one or the detailed one. I'm assuming this means the response wasn't 500 for the default error page.Is that right? – bzlm Sep 22 at 15:56 @bzlm, The OnError runs, but its about what comes from the server as response when response code is set to 500 in my controller.

The IIS replaces its own 500 Internal Server Response instead of the one (PartialView) that I am returning to the browser. This can only be prevented if I set errorMode to Detailed. But then if my module fail with 500 status code, then because of errorMode set to Detailed a detailed response (which shows the part of code that failed) is sent from the server.

I want to send Partial View if I set response code 500 and default IIS page for any code error – Nirvan Sep 23 at 0:10.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions