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 PatilPosted Oct 7, 2011, 3:22 PM
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.
Prabhu RajaPosted Oct 8, 2011, 2:14 AM
Also try to use debugging tools from Visual Studio.
http://msdn.microsoft.com/en-us/library/esta7c62(v=vs.71).aspx
Abhimanyu K VatsaPosted Oct 8, 2011, 1:44 AM
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