Hi Fred,
Placing the entire Page_Load event handler in code wouldn't catch all
exceptions that may be thrown by the page. There are many other events that
are raised during the ASP.NET page life cycle and Load is only one of them.
"ASP.NET Life Cycles"
http://msdn2.microsoft.com/en-us/library/ms227435.aspx
Error handling can be configured in the web.config, on the Page level or
handled explicitly in code using either the global.asax file or custom
HttpModules.
Of course, you are encouraged to use judicious error handling on the method
level as well. But don't just catch everything - only catch what you can
handle gracefully.
"Error Handling in ASP.NET Pages and Applications"
http://msdn2.microsoft.com/en-us/library/w16865z6.aspx
--
Dave Sexton
"Fred Chateau" <fc******@127.0.0.1wrote in message
news:uX**************@TK2MSFTNGP04.phx.gbl...
Can exceptions only be handled in a protected block?
For example, can I globally catch and handle any exception generated from an
ASP.NET page without placing the entire Page_Load event handler code in a
try-catch block?
--
Regards,
Fred Chateau
fchateauAtComcastDotNet