473,406 Members | 2,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Exception Handling Scope

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
Nov 11 '06 #1
1 1528
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

Nov 11 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

28
by: Frank Puck | last post by:
Meanwhile there are at least 8 years that compilers exist, which provide a working implementation of C++ Exception Handling. Has anything changed meanwhile? From my point of view nothing has...
9
by: chenchang | last post by:
Hi, experts. i write a simple program to test EH in G++: void throwfunction() { throw "test"; } class A { int i;
3
by: John Ruiz | last post by:
Hello. I was wondering about exceptions and how to throw them within functions/methods and catch them. Suppose that we've got: ----------------------------------------------------------------...
4
by: Robbie Hatley | last post by:
I've been playing with "auto_ptr" and the "Resource Acquisition Is Initialization" concept. On page 199 of Lippman's book "Effective C++" he says "All active local class objects of a function are...
5
by: juergen perlinger | last post by:
Hello out there. sometimes I need to have proper control of the floating point arithmetic of the C(and C++) runtime system, and using the f.p. exception handling of the C99 standard is quite...
1
by: Dan Weatherman | last post by:
Hi all, Using WMI I am attempting to catch and exception when doing a managementscope.connect operation. From the looks of things, this method starts a new worker thread through Interop that then...
1
by: Paramveer.Singh | last post by:
Hi! I am a developer working for a company which typically deploys apps on Oracle. We would like to move to postgres for obvious reasons. However, most of  our legacy apps use the exception...
132
by: Zorro | last post by:
The simplicity of stack unraveling of C++ is not without defective consequences. The following article points to C++ examples showing the defects. An engineer aware of defects can avoid...
6
by: Mohan | last post by:
Hi, I am learning the Exception Handling in C++. I wrote a small program using Exception Handling. I am using Vistual Studio 6. It is working fine in Win32 Debug build, but it is not...
5
by: NeBlackCat (lists) | last post by:
Hello everybody - my first post! And it may be the most monumentally stupid question ever asked, but I just can't see an answer after several hours experimenting, searching and reading. It's...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.