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

Mention the namespace that is used to include .net data provider for sql server in .net code?

0 Answers  


How is it possible for .NET to support many languages?

0 Answers  


Will the asp.net validators run in server side or client side?

0 Answers  


what is Repeater Control, When it is used,How it is used, what type of template is used for repeater control?

6 Answers   iSoft,


How do you define authentication in Web.Config?

2 Answers   Accenture, BirlaSoft, IBM,


Explain the use of resource manager class in .net.

0 Answers  


What are the 3 types of web?

0 Answers  


How is a property designated as read-only?

2 Answers  


What is Bundling and Minification in MVC?

0 Answers   HCL,


when u enter the data in one text box once u completed entering the text box data then one page has to be popuped and the text has to be displayed in the parent page

1 Answers  


What is the equivalent of date() and time() in asp.net?

0 Answers  


What is a web api?

0 Answers  


Categories