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 action method static?
Fetch one page value to another page without using state-managment ?
code for "For every 5days system has to create 1text file with the corresponding date and it has to store in c-drive" by using web applications
What is asp.net master page?
Describe paging in asp.net?
How to create events for a control?
Explain why it is useful to use mvc instead of webforms? : asp.net mvc
What are the modes of updation in an updatepanel?
Which of the following .NET framework supports Web API?
What are the page life cycle events?
explain code with multi inhertance
What is Cookies Less Session?
Can you explain one critical mapping? Performance issue which one is better? Whether connected lookup tranformation or unconnected one?
What is the importance of aspnet_isapi.dll, inetinfo.exe andaspnet_wp.exe in the page loading process.
How does u get record no from 5 to 15 from a dataset of 100 records?