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 you explain why it is useful to use mvc instead of webforms? : asp.net mvc
Describe a Windows Service and its lifecycle ?
What is the purpose of session management?
How do u declare static variable and how it is declared and what is its lifetime?
Elaborate differentiation between ViewState and SessionState?
What are the cookies types in asp.net?
Can action method static?
WSDL means?
Differentiate between file-based dependency and key-based dependency.
What is anonymous authentication?
What is asp.net and its advantages?
How does asp page work?
Can you clarified A Web service can only be written in .NET or not?
What is asp.net file?
What are the advantages of using sql stored procedures instead of adhoc sql queries in an asp.net web application?