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



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

Answer / 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

More ASP.NET Interview Questions

What three Session State providers are available in ASP.NET 1.1? What are the pros and cons of each ?

1 Answers  


Why the javascript validation not run on the asp.net button but run successfully on the html button?

0 Answers  


Can I stream live content/events?

0 Answers  


What is a Metadata?

3 Answers  


What is the difference between response.redirect and server.transfer, how to choose one among the other?

3 Answers   247Customer,






How many languages are supported by .NET at present time?

0 Answers  


How information about the user's locale can be accessed?

0 Answers   MindCracker,


Can we mention error in web.config file?

2 Answers  


Explain how is a property designated as read-only?

0 Answers  


What is the significance of finalize method in .net?

0 Answers  


What are session variables?

2 Answers   Microsoft,


What are the different types of sessions in asp.net? Name them?

0 Answers  


Categories