CustomErrors isn't redirecting

W

William Ryan eMVP

I'm having a problem with CustomErrors. Here's the snippet I'm using in my
web.config
<customErrors defaultRedirect="AppError.aspx" mode="On" />

Now, I'm intentionally raising an exception to test to see if it's
redirecting correctly.(I'm positive that the exception is being thrown and
it's not being handled by any try catch blocks.)

All that happens is the page goes blank but it stays on the same page. So
if I throw an exception which isn't handled on purpose on default.aspx and I
have the above referenced code in web.config, all that happens is
default.aspx stays blank on ceases to load the rest of the info. No
redirect to the AppError.aspx.

I know I can do the redirect in a try catch block, but I have very specific
exception handling and if something like a thread exception or outofmemory
exception happens that I intentionally don't handle, I want to redirect to a
specific page. Basically, if something happens that I didn't plan for, I
want to redirect no matter what instead of getting the Yellow screen of
death. While getting nothing is better than they yellow screen, it's still
not what I want.



Any ideas?
 
A

Alvin Bruney [MVP]

custom error redirection in the webconfig file is for errors outside of the
executing page. For run-time exceptions, you will need to redirect in a
catch handler.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top