Understanding Tracing in ASP.NET 2.0
page 1 of 6
Published: 23 Aug 2007
This article describes the concept of Tracing in ASP.NET 2.0.
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 26949/ 49


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#.

View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-07-24 7:24:20 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search