Server Error in Application

An unhandled exception occurred during the execution of the current web request
posts - 60, comments - 75, trackbacks - 50

My Links

News

Archives

Post Categories

ASP.NET

Exception Handler: How to get Error Code

Few day back i need error code like 404 in Application_Error event handler.
I tried and finally got it.
Dim httpErrorCode As Integer
Dim
Last Error As HttpException

LastError = HttpContext.Current.Server.GetLastError()

httpErrorCode = LastError.GetHttpCode()
That gives us http error code that would have been sent to the browser if I had not intercepted the error.
Cheers!..
Mahesh
maheshsingh21@hotmail.com

ASP.NET Interview Questions | C# Interview Questions | .NET Interview Questions | Dot Net Interview Questions | VB.NET Interview Questions | Oracle Interview Questions
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Print | posted on Friday, September 22, 2006 9:34 PM |

Feedback

No comments posted yet.
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 

Powered by: