We are going to use C#.Net code to trap and respond to errors when they occur in the ASP.net or rather I would say in our web application.
To trap the errors occurs we have written a separate class with the name ExceptionLog.cs, and we are using Global.asax to know about the error and trap through our ExceptionLog.cs class file and record the details into text file.
In the class file we will write our logic to trap the errors occurred in application and logged that error details into text file.
The Log File:
As I had mentioned that the error details would get logged in textile with the name ErrorLog.txt
We will use the benefit of Global.asax to call error trap method on any Application error.
To know more about the Global.asax file you can visit below links:
Hope it will be useful for you!!
Feel free to provide your comments and any suggestions!!