In Microsoft .NET Framework we find a "Debugging and
Tracing" feature for sorting and fixing errors, which we find in the
course of developing our web application and even sometime after the deployment
of the application. When the application are in the development stage, using
debugging feature developers can set break points in their code and can observe
the values of variables using watch window. But the use of debuggers becomes a
huge task for administrators considering the security and related issues in the
production environment. In classic ASP, using Response.Write method we can
display an error message. Although it is easy to use, it has some drawbacks.
Before deployment we have to remove or comment out all those Response.Write
statement wherever we have used in the application. We cannot forget to remove
or comment out any such statement that can be visible to end user/client.
Moreover, when we are working on any live site and using
Response.Write to fix any error in respect of any particular page/pages, there
is always a possibility that the same can be visible to the client as well. ASP.NET
introduces new functionality that allows us to write debug statements directly
in our code, without having to remove them from our application when it is
deployed to production servers. This feature provides a refined way for
outputting page-level information. It uses two methods: Trace.Write and
Trace.Warn. It should be noted that in some cases tracing provides some extra
facilities compared to debugging for example, showing the amount of information
in view state, page processing time, etc. We can enable tracing for the page or
application. The sample code snippets have been written in C#.