Grupos de Google ya no admite publicaciones ni suscripciones nuevas de Usenet. El contenido anterior sigue visible.

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

11 vistas
Ir al primer mensaje no leído

Doug

no leída,
13 jun 2006, 11:21:38 a.m.13/6/2006
para
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

no leída,
13 jun 2006, 11:43:22 a.m.13/6/2006
para
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]

no leída,
13 jun 2006, 11:41:21 a.m.13/6/2006
para
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

no leída,
13 jun 2006, 12:01:42 p.m.13/6/2006
para
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

no leída,
13 jun 2006, 1:23:40 p.m.13/6/2006
para
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

no leída,
3 jul 2006, 5:09:01 p.m.3/7/2006
para
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 mensajes nuevos