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

Home Posts Topics Members FAQ

Could we get error statusCode on ErrorPage

ad
Hi,
I use the setting below in Web.config
<customErrors mode="On" defaultRedirect="~/ErrorPage/GenericErrorPage.aspx"
/>

How could we get error statusCode when GenericErrorPage is load?
Nov 19 '05 #1
2 1481
ad wrote:
Hi,
I use the setting below in Web.config
<customErrors mode="On"
defaultRedirect="~/ErrorPage/GenericErrorPage.aspx" />

How could we get error statusCode when GenericErrorPage is load?


Have you tried Server.GetLastError()?

--
Jim Cheshire
JIMCO Software
http://www.jimcosoftware.com

FrontPage add-ins for FrontPage 2000 - 2003


Nov 19 '05 #2
Since the <customErrors> causes a redirect, the error page is a new request
into the web server, thus the previous request that caused the failure is
long gone. You need to put an Application_Error event handler in global.asax
to capture error information; this event gets called during the request that
is failing. You can then log the error information (accessibly from Context.Error).

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi,
I use the setting below in Web.config
<customErrors mode="On"
defaultRedirect="~/ErrorPage/GenericErrorPage.aspx"
/>
How could we get error statusCode when GenericErrorPage is load?

Nov 19 '05 #3

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

Similar topics

2
by: A.M | last post by:
Hi, I have this code in my web.config: <customErrors mode="On" defaultRedirect="~/ErrorPages/ErrorApp.aspx"> <error statusCode="400" redirect="~/ErrorPages/Error.aspx" /> <error...
3
by: A.M | last post by:
Hi, I have this code in my web.config: <customErrors mode="On" defaultRedirect="~/ErrorPages/ErrorApp.aspx"> <error statusCode="400" redirect="~/ErrorPages/Error.aspx" /> <error...
6
by: José Joye | last post by:
Hello, I'm currently reading the MS Developing Web applications with c# (and VB.net). In the chapter related to Error management, there is a sample about "Page-Level Error Pages" eg: In my...
0
by: ad | last post by:
I use these setting in Web.Config <customErrors mode="On" defaultRedirect="~/ErrorPage/GenericErrorPage.aspx"> <error statusCode="403" redirect="~/ErrorPage/NoAccess.aspx"/> <error...
2
by: Fred Nelson | last post by:
I'm devloping a VB.NET web application and I'm having a problem with trapping errors and logging the cause of them. When an unexpected error occurs I want to write it to a file - or e-mail it to...
2
by: JJ | last post by:
I have seen many examples to set custom error pages as follows: <customErrors mode="RemoteOnly" defaultRedirect="errors/ErrorPage.aspx"> <error statusCode="400" redirect="errors/ErrorPage400.aspx"...
1
windows_mss
by: windows_mss | last post by:
I Used the above code to Handle the HTTP Error Code, My Problem Is as follows, This My Program URL http://localhost/Work/CustErr/Default.aspx, When I alter The URL Like This...
1
by: jobs | last post by:
Hello. I've got a customerrors section in my web.config that redirects all errors to an ErrorPage.aspx <customErrors defaultRedirect="~/ErrorPage.aspx"> <error statusCode="403"...
5
by: rote | last post by:
I'm using ASP.NET 2.0 and i have copied and pasted the code below to my Global.asax file but it desn't trap the error I want to trap the 401 access denied void Application_Error(object sender,...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
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...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.