error handling in vb.net webapp

mcanic

Newcomer
Joined
May 23, 2003
Messages
2
Hi,

Can anybody with helping me with handling errors in a CLASS that is used by a VB web application? I want to catch the error and either redirect to a page that contains an errorhandler & displays the error, or display a popup window that displays the error.

try
try to make db-connection
catch e as exception
... show the error ?? how do I do this in VB with ASP.Net ?? ...
end try

Can anybody tell me how to do this?

Greetz, Gerard Alberts
 
in your Catch you can Throw an exception to the calling function..

Visual Basic:
Catch e as Exception
Throw new Exception (e.message)
Then in the calling function you can display the error in a label or on the page.
 
Back
Top