Link to home
Start Free TrialLog in
Avatar of feesu
feesu

asked on

Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)

Experts,
What's the best way to handle errors in the below event? Or is there a better way to handle errors in my website? My plan was to direct the visitor to a custom error page that corresponds to the error he gets.

    Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
    End Sub

Plus, what happens when using Server.GetLastError.Message in that event? Isn't that method reads from the server, does it read the last server error for this visitor (session) or it reads that last error in general, that could be caused by another open session (user) ??
ASKER CERTIFIED SOLUTION
Avatar of nauman_ahmed
nauman_ahmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of feesu
feesu

ASKER

Hi  nauman,
Does this work with ASP.NET 2.0 ? Because I noticed some errors while trying to write the same code in my application!
The concept is almost same in ASP.NET 2.0 and may work with some variation in the code.

--Nauman.