What is an Exception?
|
||
An exception is
an event, which occurs during the execution of a program, that disrupts the
normal flow of the program's instructions.
|
||
What are the different
approaches to handle exceptions in asp.net web application?
|
||
<customErrors
mode="RemoteOnly"
defaultRedirect="~/errors/GeneralError.aspx"
redirectMode="ResponseRewrite" /> the ResponseRewrite
mode allows us to load the Error Page without redirecting the browser, so the
URL stays the same, and importantly for me, exception information is not
lost.
|
||
What will happen if an
exception occur inside try block?
|
||
If a code in a
try block causes an exception, control flow passes to immediate catch or
finally block.
|
||
Will the finally block get
executed, if an exception doesn't occurs?
|
||
Yes, a finally
block will always be executed irrespective of whether an exception has
occured or not.
Can multiple catch blocks be executed? No, Multiple catch blocks can’t be executed. Once the proper catch code executed, the control is transferred to the finally block and then the code that follows the finally block gets executed. |
||
dot net tips, DotNet tips, .Net Tips,Dot Net tips and tricks,Dot Net Solutions, OOPS Concept in C#,SQL Server, LinQ, Ajax, Java script, JQuery, Server Error details, daily .net tips and tricks , DotNet Interview Questions.