473,473 Members | 2,031 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

CustomErrors statusCode 500

I have a customerrors section in web.config something like the following:

<customErrors mode="On" defaultRedirect="/errorPage/errorpage.aspx" >
<error statusCode="404" redirect="/errorPage/errorpage404.aspx" />
<error statusCode="500" redirect="/errorPage/errorpage500.aspx" />
</customErrors>

This works fine, but every exception in the app that isn't a 404 error gets
redirected to the statusCode 500 page which represents an Internal Server
Error. Is this standard?

Why doesn't the defaultRedirect page ever get redirected to?

I have a test page that throws an argumentException and I get redirected to
errorPage500.aspx. I want this type of exception to go to errorPage.aspx
which is the default.

Any help would be appreciated.

Thanks,
Jesse
Nov 17 '05 #1
3 4748
That's because an uncaught exception results in 500 error. The default error
page will be used for errors that do not have a page associated with them,
in your case everything else than 404 and 500.

Jerry

"Jesse Napier" <jn*****@giantsoftware.com> wrote in message
news:ey**************@TK2MSFTNGP12.phx.gbl...
I have a customerrors section in web.config something like the following:

<customErrors mode="On" defaultRedirect="/errorPage/errorpage.aspx" >
<error statusCode="404" redirect="/errorPage/errorpage404.aspx" />
<error statusCode="500" redirect="/errorPage/errorpage500.aspx" />
</customErrors>

This works fine, but every exception in the app that isn't a 404 error gets redirected to the statusCode 500 page which represents an Internal Server
Error. Is this standard?

Why doesn't the defaultRedirect page ever get redirected to?

I have a test page that throws an argumentException and I get redirected to errorPage500.aspx. I want this type of exception to go to errorPage.aspx
which is the default.

Any help would be appreciated.

Thanks,
Jesse

Nov 17 '05 #2
Thats what I thought. But can other exceptions result in a 500 error or can
I be confident that any 500 error was an uncaught exception.

I am handling uncaught exceptions in the appliacation_error event and I just
want to make sure that the user gets redirected to a friendly page so I let
the redirection be handled by the custom errors redirection in web.config.

Does that make sense?
"Jerry III" <je******@hotmail.com> wrote in message
news:#$*************@TK2MSFTNGP12.phx.gbl...
That's because an uncaught exception results in 500 error. The default error page will be used for errors that do not have a page associated with them,
in your case everything else than 404 and 500.

Jerry

"Jesse Napier" <jn*****@giantsoftware.com> wrote in message
news:ey**************@TK2MSFTNGP12.phx.gbl...
I have a customerrors section in web.config something like the following:
<customErrors mode="On" defaultRedirect="/errorPage/errorpage.aspx" >
<error statusCode="404" redirect="/errorPage/errorpage404.aspx" />
<error statusCode="500" redirect="/errorPage/errorpage500.aspx" />
</customErrors>

This works fine, but every exception in the app that isn't a 404 error

gets
redirected to the statusCode 500 page which represents an Internal Server Error. Is this standard?

Why doesn't the defaultRedirect page ever get redirected to?

I have a test page that throws an argumentException and I get redirected

to
errorPage500.aspx. I want this type of exception to go to errorPage.aspx
which is the default.

Any help would be appreciated.

Thanks,
Jesse


Nov 17 '05 #3
| Thats what I thought. But can other exceptions result in a 500 error or
can
| I be confident that any 500 error was an uncaught exception.

Generally yes. Under normal circumstances, 500 is thrown via exception. The
second way how you can get 500 is when IIS or ISAPI application fails. But
such situation is not standrd and in such case you cannot catch this
situation, because it's not running.

--
Michal A. Valasek, Altair Communications, http://www.altaircom.net
Please do not reply to this e-mail, for contact see http://www.rider.cz
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Patrick.O.Ige | last post by:
I have a Custom Error below..!! But when i try it it doesn't work. Am i suppose to make any changes in IIS for this to Work? And the Error pages for example "AccessDenied.aspx" where should they...
6
by: SMG | last post by:
Hi , Sory for incomplete message in last post here is the actual problem.. I am using following code in web.confiig for trapping all the error through out my site.. <customErrors mode="On"...
2
by: Max Metral | last post by:
I'm trying to set the default behavior of customErrors in the machine.config. The documentation seems to suggest this should work, but it doesn't seem to work for me. On my development machine, I...
9
by: =?Utf-8?B?TWlrZQ==?= | last post by:
Hi. Is it programatically possible in VB.NET to read the contents of web.config's <customErrorselement? I looked at using ConfigurationSettings.AppSettings, but that doesn't work. I need to...
2
by: rmgalante | last post by:
I encrypted my connectionStrings section with the following command. aspnet_regiis -pef "connectionStrings" "C:\Inetpub\wwwroot \MyVirtualDirectory" It worked and I can see that the...
1
by: JJ | last post by:
I've a strange problem: My customErrors section in my web.config doesn't seem to be working on the live host. By that, I mean that when I type in an address of a page that doesn't exist, I get...
2
by: David Lozzi | last post by:
Howdy, I'm using the following code, asp.net 2.0 <customErrors mode="On" defaultRedirect="oops.aspx"> <error statusCode="403" redirect="notfound.aspx" /> <error statusCode="404"...
0
by: baburk | last post by:
Hi, I want to use the <customErrors> for all <system.web></system.web> If error occure this should be called. I have to write it once not in every <system.web></system.web>. How can I?
3
by: Tahir | last post by:
Hi, i am delevoping an ASP.NET website which worked well on my old web host and now working on localhost but now it doesnt works on my new host. i have new registered and ftp the files that...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.