ChevCast
ChevCast

Reputation: 59231

Can you turn off custom errors programmatically?

We have a web application that has custom errors turned on so that users see a friendly error. Is there a way to disable custom errors on a per request basis? Say, if we make a request from a specific IP address then custom errors are disabled?

I know you can set it to "RemoteOnly" and custom errors will be off when making requests from localhost, but that requires someone to remote into the machine running the application and make the request from there. It would be nice if we could just write some logic to disable custom errors under certain conditions.

Upvotes: 2

Views: 2108

Answers (1)

BluesRockAddict
BluesRockAddict

Reputation: 15683

Here is one solution which might work for you.

Upvotes: 3

Related Questions