473,322 Members | 1,562 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

2.0: Application_Error()

Could you tell me please how can I get some information about error in
Global.asax Application_Error()?

void Application_Error(object sender, EventArgs e)
{
// Here I need to get some information about error
Response.Redirect("Problem.html");
}

Thank you very much
/RAM/
Jun 12 '06 #1
3 930
Server.GetLastError()

R.A.M. wrote:
Could you tell me please how can I get some information about error in
Global.asax Application_Error()?

void Application_Error(object sender, EventArgs e)
{
// Here I need to get some information about error
Response.Redirect("Problem.html");
}

Thank you very much
/RAM/

Jun 12 '06 #2
Server.GetLastError will return the last uncaught exception. You'll often
want to check it's InnerException (first check for null) as GetLastError is
likely to return a somewhat meaningless HttpUnhandledException.

Karl

--
http://www.openmymind.net/

"R.A.M." <r_********@poczta.onet.pl> wrote in message
news:n7********************************@4ax.com...
Could you tell me please how can I get some information about error in
Global.asax Application_Error()?

void Application_Error(object sender, EventArgs e)
{
// Here I need to get some information about error
Response.Redirect("Problem.html");
}

Thank you very much
/RAM/

Jun 12 '06 #3
Here is an article with a logging framework for this:

http://www.eggheadcafe.com/articles/20060531.asp

Response.Redirect might prove problematic.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"R.A.M." wrote:
Could you tell me please how can I get some information about error in
Global.asax Application_Error()?

void Application_Error(object sender, EventArgs e)
{
// Here I need to get some information about error
Response.Redirect("Problem.html");
}

Thank you very much
/RAM/

Jun 12 '06 #4

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

Similar topics

1
by: Greg Burns | last post by:
I am trying to write a global custom error page. I thought I would jot down some of what I've learned so far... At first I just used the default customErrors section with a defaultRedirect tag,...
3
by: tafs7 | last post by:
My code below is supposed to email me when an error occurs on the application, but it's not emailing anything. Am I missing something? I know the smtp servers I've tried work. I even added a...
3
by: Mike Malter | last post by:
I have a general error page that I configured in web.config as <customErrors mode="On" defaultRedirect="CRDefaultError.aspx" /> This error page comes up whenever an error occurs outside of any...
0
by: Michael | last post by:
Hi, I have an ASP.NET application that catches un-handled exceptions in the Application_Error method and writes the details to the Event Log. But, if I do a Server.ClearError() followed by either...
0
by: Michael | last post by:
Hi, I have an ASP.NET application that catches un-handled exceptions in the Application_Error method and writes the details to the Event Log. But, if I do a Server.ClearError() followed by either...
2
by: Carl Johansen | last post by:
I've been reading the O'Reilly "ASP.NET Cookbook" 1st edition (Kittel and LeBlond), and it makes a recommendation about exception handling that seems a bit strange. They say that, if you want to...
6
by: Matt | last post by:
Can anyone give me a good reason to use BOTH application scope Page_Error and the page scope Page_Error when trapping errors in a web application? Is there any real benefit to using the Page_Error...
2
by: Matt | last post by:
As the subject says... are Application_Error and Page_Error triggered by the same event? In other words, is there any error that could slip by Application_Error but be caught by Page_Error, or...
6
by: Rippo | last post by:
I have a problem with the application_error event being fired from my asp.net application with windows 2003 server standard edition. The event fires fine from my test machine (XP) and all works...
1
by: =?Utf-8?B?UGhpbCBKb2huc29u?= | last post by:
I have a web app that handles errors in the Gloabal.ascx's Application_Error(). It does some logging etc in there and if it throws an error, I want the app to display a static html splash page...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.