Asp.net - How to find last error which occurred?

Answer Posted / p.ramakrishna

Exception LastError;
String ErrMessage;
LastError = Server.GetLastError();
if (LastError != null)
ErrMessage = LastError.Message;
else
ErrMessage = "No Errors";
Response.Write("Last Error = " + ErrMessage);

Is This Answer Correct ?    14 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Difference between using directive vs using statement?

695


Which protocol is used to call a web service?

773


What are server-side comments in ASP.NET?

762


Explain the path instructions in xaml?

754


Are xaml file compiled or built on runtime?

729


Explain file-based dependency and key-based dependency.

761


What are the disadvantages of view state?

818


What is inproc and outproc?

740


What is the maximum number of classes that can be contained in one dll file?

933


What are all the various Estimation Techniques available ?

862


I’m having some trouble with cas. How can I diagnose my problem?

790


What are the new features added from ASP to ASP.NET?

781


How do u deploy your asp.net application?

785


What is & in a url?

716


What is form submit?

695