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. Advertisements

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:
    478
    Kenneth Keeley
    Jul 1, 2003
  2. VSK
    Replies:
    1
    Views:
    1,024
    Alvin Bruney
    Jul 29, 2003
  3. J.Marsch

    Re: error handling in c#

    J.Marsch, Aug 13, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    622
    J.Marsch
    Aug 14, 2003
  4. suzy

    c#/aspx error handling

    suzy, Aug 14, 2003, in forum: ASP .Net
    Replies:
    11
    Views:
    1,018
    Kevin Spencer
    Aug 18, 2003
  5. Leo R

    Error-handling

    Leo R, Oct 22, 2003, in forum: ASP .Net
    Replies:
    5
    Views:
    1,793
    Jacob Yang [MSFT]
    Oct 28, 2003
  6. Mark Tarver
    Replies:
    22
    Views:
    1,664
    J Kenneth King
    Apr 26, 2009
  7. Peter
    Replies:
    34
    Views:
    2,406
    James Kanze
    Oct 17, 2009
  8. Iñaki Baz Castillo
    Replies:
    1
    Views:
    459
    Iñaki Baz Castillo
    Apr 15, 2008
Loading...