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

Code for updating the database by entering the data into textboxes in aspx form?

2 Answers   TCS, Wipro,


What do you mean by role-based security?

0 Answers  


What are the different ways of processing data in ASP page in the server side (like Forms, QueryStrings etc)?

1 Answers  


What is the Difference between Web.config and global.asax? Can we write connection String code in global.asax?

10 Answers   Microsystems,


Define web services in asp.net.

0 Answers  






Create the Output by mearging 2 tables and taking common column sid from both you should not use database create table and data in it Randomly table 1 sid sname saddress 1 sa ampt 2 na hyd 3 ha hyd table 2 sid dno dname 1 12 stats 2 23 phy 3 12 stats OutPUt sid sname saddress did dname 1 sa ampt 12 stats 2 na hyd 23 phy 3 ha hyd 12 stats

1 Answers  


Explain login controls.

0 Answers  


if i have placed the button control with the OnClick event like <asp:Button ID="mybutton" runat="server" Text="Insert" onclick="mybutton_Click" /> and some other controls(buttons, textboxes) in .aspx page. When i run the page, the button displays in the page source of the browser like <input type="submit" name="mybutton" value="Insert" id="mybutton" /> here, it does not display the onclick event, then how the page calls the button click on the server side, how the server side identify which button cause the submit, and how this page moves to the server side.

1 Answers  


What is windows active directory authentication?

0 Answers  


When would you set this property to false?

2 Answers  


How does asp.net work?

0 Answers  


In the context of a comparison, what is object identity versus object equivalence?

1 Answers  


Categories