How can u handle Exceptions in Asp.Net?

Answers were Sorted based on User's Feedback



How can u handle Exceptions in Asp.Net?..

Answer / aadil

In ASP.NET, we have three types of Error Handling.
1. Structured Level Error Handling (try..catch..finally
block)
2. Page Level Error Handline
3. Application Level Error Handling.

Is This Answer Correct ?    3 Yes 0 No

How can u handle Exceptions in Asp.Net?..

Answer / poornima p

In ASP.NET exception handling is achieved using the Try ?
Catch ? Finally block. All the three are ASP.NET keywords
and are used do exception handling. The try block encloses
the statements that might throw an exception whereas catch
block handles any exception if one exists. The finally
block can be used for doing any clean up process. Any
general ASP.NET exception forces the application to
terminate without allowing the code to continue executing,
resulting in an error page.

<Script runat=server>
Public Page_Load(sender As Object, e As EventArgs)
{
try
{
// Statements that are can cause exception
}
catch(Type x)
{
// Statements to handle exception
}
finally
{
// Statement to clean up
}
}
</Script>
Custorm Errors:
The default settings that is available in machine.config is
as follows
<customErrors mode="RemoteOnly"/>

Is This Answer Correct ?    1 Yes 0 No

How can u handle Exceptions in Asp.Net?..

Answer / guest

using system.exceptions namespace

Try
Piece of code ..
Catch objError as Exceptions
display objError.message
Finally

Is This Answer Correct ?    0 Yes 0 No

How can u handle Exceptions in Asp.Net?..

Answer / senthil kumar

try
{
//set of code
}
catch(Exception1 e)
{
//error display
}
catch(Exception2 e)
{
//error display
}
finally
{
//compulsory execution will be done here
}

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More ASP.NET Interview Questions

Is there any limit for query string? Means what is the maximum size?

0 Answers  


What are the different types of events are occured when a client requests an ASP.NET page from IIS server?

0 Answers   Sans Pareil IT Services,


What happens if an ASP.NET server control with event-handling routines is missing from its definition?

0 Answers   MindCracker,


hai to all. what is the procedure for " web hosting ".If you know please message me at "yoursguna@gmail.com". Thank u...

1 Answers  


What are Caching techniques in .NET

0 Answers   Microsoft,






What?s a bubbled event?

1 Answers  


What are the new features added from ASP to ASP.NET?

0 Answers   Amdocs,


What is the caspol.exe tool used for?

0 Answers  


What is the use of express session?

0 Answers  


Difference between ASP & ASP.NET Session State

1 Answers   Cognizant, Wipro,


Types of session management in ASP.NET ?

2 Answers   Microsoft,


Is it possible to disable the minimized icon of a popup window using window.open. Not using iframe concept?

3 Answers   AFAS, Take United,


Categories