Simple, solution-wide error trap in VB.NET?

Discussion in 'ASP .Net' started by Doug, Jun 13, 2006.

  1. Doug

    Doug Guest

    Found this thread, but code is C# (would rather have VB.NET).

    http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q306355

    Can anyone point me to a simple solution? We don't want the error
    codes appearing to the end-user, but obviously we want to be able to
    log and e-mail them, etc.

    According to what I've been reading, the way to accomplish this is to
    change the "CustomErrors" mode and the 'defaultRedirect' in web.config,
    rather than enclose every piece of code with "Try...Catch". Is this
    correct?
     
    Doug, Jun 13, 2006
    #1
    1. Advertising

  2. There are a couple of other ways:

    1. Define a BasePage class for all your pages to inherit from. In it,
    handler the Error event and process appropriately.
    2. Handle the Application_Error in global.asax, and process appropriately

    "Doug" <> wrote in message
    news:...
    > Found this thread, but code is C# (would rather have VB.NET).
    >
    > http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q306355
    >
    > Can anyone point me to a simple solution? We don't want the error
    > codes appearing to the end-user, but obviously we want to be able to
    > log and e-mail them, etc.
    >
    > According to what I've been reading, the way to accomplish this is to
    > change the "CustomErrors" mode and the 'defaultRedirect' in web.config,
    > rather than enclose every piece of code with "Try...Catch". Is this
    > correct?
    >
     
    Marina Levit [MVP], Jun 13, 2006
    #2
    1. Advertising

  3. Doug

    Doug Guest

    I should add that we are using Visual Studio 2005 and SQL Server 2000.

    Also, the C# example I cited earlier was designed for .Net 2002/2003.
     
    Doug, Jun 13, 2006
    #3
  4. Doug

    Doug Guest

    Marina Levit [MVP] wrote:
    > There are a couple of other ways:
    >
    > 1. Define a BasePage class for all your pages to inherit from. In it,
    > handler the Error event and process appropriately.
    > 2. Handle the Application_Error in global.asax, and process appropriately


    Thank you. Is there still a global.asax in VS2005?

    Also, I found the VB.NET equivalent of the C# example I cited above:

    http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q308132

    but it, too, references global.asax, which I don't see anymore in
    VS2005.
     
    Doug, Jun 13, 2006
    #4
  5. Doug

    Patrice Guest

    It still there. It's not added for you if you choosed to create an empty web
    site. Just add an item , it should in the list...

    --
    Patrice

    "Doug" <> a écrit dans le message de news:
    ...
    > Marina Levit [MVP] wrote:
    >> There are a couple of other ways:
    >>
    >> 1. Define a BasePage class for all your pages to inherit from. In it,
    >> handler the Error event and process appropriately.
    >> 2. Handle the Application_Error in global.asax, and process appropriately

    >
    > Thank you. Is there still a global.asax in VS2005?
    >
    > Also, I found the VB.NET equivalent of the C# example I cited above:
    >
    > http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q308132
    >
    > but it, too, references global.asax, which I don't see anymore in
    > VS2005.
    >
     
    Patrice, Jun 13, 2006
    #5
  6. Doug

    Doug Guest

    Doug, Jul 3, 2006
    #6
    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. Web Developer

    char 8bit wide or 7bit wide in c++?

    Web Developer, Jul 31, 2003, in forum: C++
    Replies:
    2
    Views:
    599
    John Harrison
    Jul 31, 2003
  2. Replies:
    4
    Views:
    3,304
  3. Disc Magnet
    Replies:
    2
    Views:
    727
    Jukka K. Korpela
    May 15, 2010
  4. Disc Magnet
    Replies:
    2
    Views:
    802
    Neredbojias
    May 14, 2010
  5. Martin Rinehart

    80 columns wide? 132 columns wide?

    Martin Rinehart, Oct 31, 2008, in forum: Javascript
    Replies:
    16
    Views:
    186
    John W Kennedy
    Nov 13, 2008
Loading...

Share This Page