throw exception back to the page

S

SteveS

Hello,

I created a user control where there are several text boxes and a button.
When the user clicks the button, I want to validate the data. When the the
data is not valid, I would like to throw an exception. Is there a way to
handle that exception on the main page? In other words, after the code
throw new excpetion("you data is screwed up"), I would like to hit code on
the main page to handle it.

Thank you,

SteveS
(e-mail address removed)
 
G

Guest

Hi Steve,

You can have your own Exception, just like the one used
in the Catch statement.

Try

Catch ex as Exception

End Try

As the Message property of the Exception eobjkect is read-
only,
 
G

Guest

Sorry Steve,


Hit Send (enter) by mistake !)

Here is how :

-----------------------

Dim oExcep as Exception

oExcep = New Exception("you data is screwed up")

Throw oExcep
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top