Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

11 views
Skip to first unread message

Doug

unread,
Jun 13, 2006, 11:21:38 AM6/13/06
to
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

unread,
Jun 13, 2006, 11:43:22 AM6/13/06
to
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.

Marina Levit [MVP]

unread,
Jun 13, 2006, 11:41:21 AM6/13/06
to
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" <spam...@gmail.com> wrote in message
news:1150212098....@f14g2000cwb.googlegroups.com...

Doug

unread,
Jun 13, 2006, 12:01:42 PM6/13/06
to
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

unread,
Jun 13, 2006, 1:23:40 PM6/13/06
to
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" <spam...@gmail.com> a écrit dans le message de news:
1150214502.7...@c74g2000cwc.googlegroups.com...

Doug

unread,
Jul 3, 2006, 5:09:01 PM7/3/06
to
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.

Can you take a look at this thread and help me figure out what to do
next to implement this?

http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_frm/thread/82b963fca65314a8/644bfe5b8015aaa8?hl=en#644bfe5b8015aaa8

Thanks.

0 new messages