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 |
HI, I have a very important query in mind. Please help me regarding this. I don't have any real time exp in .net. But I have a knowledge it .net. I got an offer from an MNC company as a software developer has I had kept 2 years of fake exp. Even though for this job I had worked hard to crack interview for more then a year. So, I would like to know how difficult it will be for working in real time as I don't have real time exp. Please tell me as soon as possible bcoz I need to join by next month. Can i sustain over there for a longer time or not. And also let me know how to work pressure will be over there. Please help me regarding this. I'm getting tension thinking about it. Thank you.
what is COM Object in Dot net?
Write a code for "RequiredFieldValidator" in java script
What is asp.net web application?
Can any one explain with the example how to capture the application error in Aplication_Error() method?
can we transfer data from one page to another page using viewstate if so how?if not y?
Tell About Web.config ?
can we pass coditions in swtich case?
Can we use http handlers to upload a file in asp.net?
What is the Custom Error in ASP.NET?
2 Answers ABB, IBM, Infosys, Tech Mahindra,
How would ASP and ASP.NET applications run at the same time on the same server?
What is viewstate information stored?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)