How to handle error while project running on live

Answers were Sorted based on User's Feedback



How to handle error while project running on live ..

Answer / tiger skumar

Its very essential to track the error in the live server.
When end user use the project, some error may come on live
server. We can use the an email id to capture them in the
exception block and sends them email.

try
{
----
----
----
}
catch(Exception oEx)
{
MailMessage oMM = new MailMessage();
oMM.To ="skumaar_mca@yahoo.com";
oMM.Subject = oEx.ToString();
StringBuilder oSB = new StringBuilder();
oSB.Append("Browser:"+Request.Browser);
oSB.Append("Url:"+Request.Url);
oSB.Append("IP Address:"+Request.UserHostAddress);
oSB.Append("Error:"+oEx.Message());
oMM.Body = oSB.ToString();
SmtpClient.Send(oMM);

This is sample coding for how to capture in the liver server.

No need to the write the above piece of coding in the every
place.

Just create an project and put the code in that class.
We can use the error message to that class and we can send
the email from there.


}

Is This Answer Correct ?    4 Yes 0 No

How to handle error while project running on live ..

Answer / sandeep

Only using application error log file and to show internal
server error

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More ASP.NET Interview Questions

How do you use a custom validator? When might you want to use one?

3 Answers   Infosys,


How to deploy the Asp.Net Project ?

3 Answers  


What is the default authentication mode for asp.net?

0 Answers  


What are sql joins?

0 Answers  


Have you used microsoft dataaccess blocks and Exception blocks?

1 Answers   Microsoft,






Explain the difference between singleton and single call?

0 Answers  


I have one application, one user purchase some products in my application? and another person came he is also purchase some products?how can we identify which user purchase which items? my answer is by using session id? but i dont know how? can u give me programming for that?

1 Answers  


How can we apply themes to an asp.net application?

0 Answers  


What is custom events? How to create it?

0 Answers  


Define what is razor? : asp.net mvc

0 Answers  


How do you enable tracing? a) Set the Trace property of the Web Form to True b) Set the Trace property of the server object to True c) Set the Session variables Trace to True d) Set the Applications Variable Trace to True.

2 Answers   Syntax Softtech,


On Age field how many Asp.Net validation controls will be suit?

7 Answers   NTTF Nettur Technical Training Foundation, Quest,


Categories