ASP.NET error checking
When working with C# asp.net 2010 web controls, I am wondering if there is a method for handling errors? Basically is there any special way of handling errros that can occur? If not, when a web control is being accessed, should I put the code within a try-catch block?

Pravin Patil60 reputationPosted Oct 7, 2011, 11:22 AM EDT
But in the catch block you can log this error. You can log the error in Eventviewer, Text File etc. so that at a later time you can have a look at the situation which lead to this error. You can use Microsoft Logging Application Block, NLog etc frameworks for logging purpose.
Hope this helps.
All the best.
Abhimanyu K VatsaRank #14 · 51.7K reputationPosted Oct 7, 2011, 9:44 PM EDT
More ways:-
(i) Placing break-points on desired code-line and watch its output
(ii) Using Text Visualizer
(iii) Using customErrors handler in configuration files
Please go through following urls for more help
http://www.worldofasp.net/tut/ErrorHandling/Error_Handling_techniques_in_ASPNET_20_82.aspx
http://dotnetguts.blogspot.com/2007/10/error-handling-in-net-with-example.html
http://www.c-sharpcorner.com/UploadFile/akukreja/CustomErrorHandlingASPNET11142005235614PM/CustomErrorHandlingASPNET.aspx
Prabhu RajaRank #861 · 2.6K reputationPosted Oct 7, 2011, 10:14 PM EDT
Also try to use debugging tools from Visual Studio.
http://msdn.microsoft.com/en-us/library/esta7c62(v=vs.71).aspx