Wrox Programmer Forums
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 7th, 2006, 05:30 AM
Authorized User
 
Join Date: Nov 2006
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to obtain Exception ID?

Hi all.
How can i get ID of an Exception?

 
Old December 7th, 2006, 10:49 AM
Authorized User
 
Join Date: Sep 2006
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Depends on how you are attempting to handle the exception.

If you are using a "try catch" block, then you will need to use the exception object's number &/or message properties. For example:

Try
     ...some code...

catch e as exception
     ...code to gracefully handle exception..
     lblMessages.text = "The following error occurred: '" & e.message & "'.<br>Error Code: '" & e.number & "'.
end try

Just be sure that if you do something like this that there is a label name "lblMessages.text" in your .aspx page. ;)

I know the above uses both the .number & .message properties, but you get the idea.

 
Old December 7th, 2006, 12:53 PM
Authorized User
 
Join Date: Sep 2006
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What are going to do with The ID

 
Old December 11th, 2006, 03:51 AM
Authorized User
 
Join Date: Nov 2006
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i want my appliction to do different works with different excapetion IDs. it means action of my application after occuring an exception is dependent to number of the exception...
anyway i hope the way that pbranumfl offered work.
i am going to test it.
thanks for your replies.






Similar Threads
Thread Thread Starter Forum Replies Last Post
How to obtain fields of a certain table? MTLedari ASP.NET 2.0 Professional 2 September 27th, 2007 03:56 PM
how to obtain - for example(page.aspx?id=12) preetham.sarojavenkatesh Visual Studio 2005 4 September 11th, 2007 12:47 PM
Obtain Primary IPAddress acuze C# 2005 0 July 27th, 2006 12:33 AM
Is it possible to obtain the windows login? sswingle Classic ASP Basics 8 April 24th, 2006 10:01 PM
why not index.asp?id=1 can be www.myweb.com/?id=1 BurhanKhan Classic ASP Professional 11 September 6th, 2004 02:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.