Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 7th, 2006, 05:30 AM
Authorized User
 
Join Date: Nov 2006
Location: , , .
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?

Reply With Quote
  #2 (permalink)  
Old December 7th, 2006, 10:49 AM
Authorized User
 
Join Date: Sep 2006
Location: Sunrise, FL, USA.
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.

Reply With Quote
  #3 (permalink)  
Old December 7th, 2006, 12:53 PM
Authorized User
 
Join Date: Sep 2006
Location: , , .
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What are going to do with The ID

Reply With Quote
  #4 (permalink)  
Old December 11th, 2006, 03:51 AM
Authorized User
 
Join Date: Nov 2006
Location: , , .
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.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 08:56 AM.


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