Have you put the code in try/catach, in which u r calling
c# class.
Exceptiption class is the base class for all exceptions.
When an error occurs, either the system or the currently
executing application reports it by throwing an exception
containing information about the error. Once thrown, an
exception is handled by the application or by the default
exception handler.
Check out this URL:
http://samples.gotdotnet.com/quickst.../srcview.aspx?
path=%2fquickstart%2fhowto%2fsamples%2fexceptions% 2fthrow%
2fthrow.src
Ravikanth[MVP]
-----Original Message-----
hello,
i am trying to write aspx login system and the login process requires avalidity check of username and password.
i have a c# class which calls the database and checks if the username andpassword is valid, but if an incorrect username or password is entered iwant to raise an error to the aspx so i can display the error message. (ihope this is the best way!).
my code that raises the error is the username/password is invalid is:
throw new Exception("The username/password is invalid.");
my problem is that when i run/debug my code this line makes the aspx stoprunning and the error is displayed as a system error on the aspx page. howcan i pass the error message back to my aspx page so i can display it?
thanks
.