Could we get error statusCode on ErrorPage

  • Thread starter Thread starter ad
  • Start date Start date
A

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?
 
ad said:
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
 
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
 

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

Error Handling 2
Error Handling Question(1) 3
CustomErrors statusCode 500 3
Custom Error Pages 2
<customErrors 3
Incorrect Server Error in config file 3
HTTP Error 404 1
CustomError Problem 4

Back
Top