Enable Page Tracing

There are times when you really want to know how your page was processed, what controls were loaded, etc.

Well, there’s an old trick that not every developer knows they can turn on… page tracing output. This is easily done, and I like the idea of doing it on all development environments (but NEVER on a production environment).

In the web.config file for which ever web application you want to enable page tracing output on, add the following line somewhere within the “<system.web>” section:

     <trace enabled="true" pageOutput="true" requestLimit="200" traceMode="SortByTime" />

At the bottom of every page in that web application (at least for SharePoint), you’ll see the complete listing of the page processing, the controls loaded, and every step the system went through to render the pages.

No, this doesn’t show EVERYTHING, but it can be very useful when your page suddenly takes two minutes to load because of your web part… or your deployed web part appears to crash the application pool (especially after numerous loads).

Happy coding!