Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get URL of error page in global.asax's Application_OnError

I have an ASP.NET application where I am tracking my application level errors using Global.asax On_Error method. I will send an email to my id when there is some error happened in the site (i.e.: when the Application_Error being invoked). Now from my Global.asax's Application_OnError event, how can I get the URL of the page where this error was raised?

like image 869
Shyju Avatar asked Jan 25 '10 21:01

Shyju


3 Answers

Use Request.Url

like image 162
Alex LE Avatar answered Oct 17 '22 23:10

Alex LE


You can use:

HttpContext.Current.Request.Url
like image 31
womp Avatar answered Oct 17 '22 23:10

womp


Will Request.RawUrl work?

like image 38
lance Avatar answered Oct 18 '22 01:10

lance