error handling in c#

Discussion in 'ASP .Net' started by Ravikanth[MVP], Aug 13, 2003.

  1. Hi

    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/quickstart/util/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 a
    >validity check of username and password.
    >
    >i have a c# class which calls the database and checks if

    the username and
    >password is valid, but if an incorrect username or

    password is entered i
    >want to raise an error to the aspx so i can display the

    error message. (i
    >hope 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 stop
    >running and the error is displayed as a system error on

    the aspx page. how
    >can i pass the error message back to my aspx page so i

    can display it?
    >
    >thanks
    >
    >
    >.
    >
    Ravikanth[MVP], Aug 13, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kenneth Keeley

    Error Handling

    Kenneth Keeley, Jul 1, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    380
    Kenneth Keeley
    Jul 1, 2003
  2. VSK
    Replies:
    1
    Views:
    779
    Alvin Bruney
    Jul 29, 2003
  3. Mark Tarver
    Replies:
    22
    Views:
    1,299
    J Kenneth King
    Apr 26, 2009
  4. Peter
    Replies:
    34
    Views:
    1,934
    James Kanze
    Oct 17, 2009
  5. Iñaki Baz Castillo
    Replies:
    1
    Views:
    183
    Iñaki Baz Castillo
    Apr 15, 2008
Loading...

Share This Page