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

What tags do you need to add within the asp:datagrid tags to bind columns manually? How?

520


What is base class of button control in .net?

531


What is master page in dtp?

552


Explain difference betn dataset and recordset?

534


Describe the Server Control Events of ASP.NET?

661






What are strong names?

594


How can we call webservices in Banking Applications? and where we are using it?

1538


What is the difference between a default skin and a named skin?

599


What does asp in asp.net stand for?

524


Where code pages are used?

694


What is the difference between custom controls and user controls?

483


Explain why datareader is useful?

554


Explain advantages of caching?

534


What is autopostback true?

614


How to unit test Web API?

711