Custom error handling

Discussion in 'ASP .Net' started by Dave Bartlett, May 23, 2004.

  1. How would I go about handling errors in ASP.NET applications such that an
    email is automatically sent to system admin with full details of the error
    on the page (regardless of whether it was a compiler or runtime error)?
     
    Dave Bartlett, May 23, 2004
    #1
    1. Advertising

  2. Dave Bartlett

    Eric Marvets Guest

    You could use the Application_Error event in the global.asax file to capture
    the event and use Server.GetLastError to get the particular error. You
    could then use ClearError to clear out the error and redirect to a custom
    page. You can also accomplish the same thing, as far as redirection, from
    the web.config file.


    --
    Eric Marvets
    Principal Consultant

    the bang project

    <shameless self promotion>

    Email for Information on Our Architecture and
    Mentoring Services

    </shameless self promotion>
     
    Eric Marvets, May 24, 2004
    #2
    1. Advertising

  3. Check out this support link,
    http://support.microsoft.com/?id=308132

    --
    Saravana
    Microsoft MVP - ASP.NET
    www.extremeexperts.com



    "Eric Marvets" <> wrote in message
    news:eg$...
    > You could use the Application_Error event in the global.asax file to

    capture
    > the event and use Server.GetLastError to get the particular error. You
    > could then use ClearError to clear out the error and redirect to a custom
    > page. You can also accomplish the same thing, as far as redirection, from
    > the web.config file.
    >
    >
    > --
    > Eric Marvets
    > Principal Consultant
    >
    > the bang project
    >
    > <shameless self promotion>
    >
    > Email for Information on Our Architecture and
    > Mentoring Services
    >
    > </shameless self promotion>
    >
    >
     
    Saravana [MVP], May 24, 2004
    #3
    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. =?Utf-8?B?Sm9yZ2UgTWF0b3M=?=

    Handling errors and not redirecting to a custom error page

    =?Utf-8?B?Sm9yZ2UgTWF0b3M=?=, Oct 29, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    513
    Matt Berther
    Oct 29, 2004
  2. =?Utf-8?B?dmJNZW50YWw=?=

    Remind me please about custom error handling

    =?Utf-8?B?dmJNZW50YWw=?=, Dec 9, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    406
    =?Utf-8?B?VHUtVGhhY2g=?=
    Dec 10, 2004
  3. Mr Newbie

    Custom Error Handling Problem /Question

    Mr Newbie, Sep 30, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    557
    Mr Newbie
    Oct 1, 2005
  4. =?Utf-8?B?U3VoYXMgVmVuZ2lsYXQ=?=

    What is the best way for handling Errors & giving Custom Error mes

    =?Utf-8?B?U3VoYXMgVmVuZ2lsYXQ=?=, Jul 21, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    355
    =?Utf-8?B?U3VoYXMgVmVuZ2lsYXQ=?=
    Jul 21, 2006
  5. Anton Aylward

    Custom error handling question

    Anton Aylward, Dec 6, 2007, in forum: Ruby
    Replies:
    2
    Views:
    117
    Morton Goldberg
    Dec 7, 2007
Loading...

Share This Page