Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: ASP.NET
Expertise: Advanced
Jan 24, 2005

Use Page Tracing to Obtain Information About Your Executing Web Page

Say goodbye to inline Response.Write statements for debugging in ASP.NET! In addition to its built-in debugging capabilities, Visual Studio .NET also supports a new mechanism for run-time debugging, called page tracing.

To enable or disable page-level tracing, access the HTML code of your ASPX page. Modify the Page statement to include:


<@ Trace="True" ...
Once the Trace attribute is set, run your ASP.NET application and observe the results. At the bottom of your page output, you should see information, covering controls, cookies, server variables, sessions, and more. You'll also be able to use the Write and Warn methods of the intrinsic Trace object to output information to the browser. This information comes at the end of the page's normal output, with Warn statements showing up in red. This simple directive can be extremely helpful in debugging pages, following the values of variables, seeing the ServerVariables collection, etc.

Note: Do not leave Tracing on in production environments.

Parthasarathy Mandayam
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap