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
i develop a web application and i gave security setting i.e autherization and athentication now it work properly on my local system , now question is ,is this security setting ie autherization and athentication which i gave in web.config will it be enough strong to secure my application on internet or i have to use some 3rd party tool or software to get security .if yes --how ? if no--what is the alternate?
What is syntax code to send email from an asp.net application?
What is asp according to you?
What do you mean by View State and what is its role?
How do u deploy ur project?
What events will occur when a page is loaded?
Describe the sequence of action takes place on the server when ASP.NET application starts first time?
How do sessions work?
Name the tools or API for developing or testing web api?
When you are running a component within ASP.NET, what process is it running within on Windows XP? Windows 2000? Windows 2003?
calling result set one procedure to anothar procedure in sql2000
3. What goals do you have in your career?
How can I open ashx file in mobile?
What is meant by server side scripting?
How can we provide the WebParts control functionality to a server control?