Answer Posted / 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 |
Post New Answer View All Answers
Can we override the enablepartialrendering property of the scriptmanager class?
Differentiate between a page theme and a global theme?
Where sessions are stored?
Define session in asp.net.
What is side-by-side execution? Can two applications, one using a private assembly and other using a shared assembly, be stated as side-by-side executables?
How does session authentication work?
Explain the difference between singleton and single call?
How u refer webservices?
What r the asp.net list controls and difference between them?
Suppose you want an asp.net function (client side) executed on the mouseover event of a button. Where do you add an event handler?
Define web services in asp.net.
Explain the use of view state?
Why do I get error message "could not load type" whenever I browse to my asp.net web site?
Explain the difference between web user control and web custom control?
What is synchronous and Asynchronous post back ?