How can u handle Exceptions in Asp.Net?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
Explain global assembly cache.
Where is asp.net view state stored?
What type of code (server or client) is found in a Code-Behind class?
how to add cliet side event to server side? and how to register client script to sever side? wt difference these two
Define machine.config in .net?
Apart from IDE what are the enhancements in asp.net 2.0?
what is the trace in ASP.NET
Write the different features of a Thread and a Process?
How can you pass multiple complex types in Web API?
What does AspCompat="true" mean and when should I use it?
what are Httpmodule and HttpHandler?
What is a session http?