Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.
ASP.NET: Enabling page tracing
From Wiki
Summary: Enabling page tracing
Page tracing allows you to look at a series of tables containing execution details about the ASP.NET page request. To turn it on for an individual page, add it to your Page directive e.g.
- <%@ Page Trace="true" %>
You can also add it at a site wide level via the web.config file e.g.
- <trace
- enabled="false"
- localOnly="true"
- mostRecent="false"
- pageOutput="false"
- requestLimit="10"
- traceMode="SortByTime"
- writeToDiagnosticsTrace="false"
- />
This next collection of tables shows an example output of page tracing with each section seperated in different code blocks (for easier reading):
Contents [Hide] |
Request Details
- Session Id: ooj01b55jsm3pbrsuzndjny4 Request Type: GET
- Time of Request: 30/06/2008 21:12:10 Status Code: 200
- Request Encoding: Unicode (UTF-8) Response Encoding: Unicode (UTF-8)
- '''Trace Information'''
- Category Message From First(s) From Last(s)
- aspx.page Begin PreInit
- aspx.page End PreInit 0.0414658175793025 0.041466
- aspx.page Begin Init 0.0416244774719023 0.000159
- aspx.page End Init 0.0419913760405645 0.000367
- aspx.page Begin InitComplete 0.0420056954065438 0.000014
- aspx.page End InitComplete 0.0420163705507756 0.000011
- aspx.page Begin PreLoad 0.0420260335775458 0.000010
- aspx.page End PreLoad 0.0420388647116364 0.000013
- aspx.page Begin Load 0.0420485696604316 0.000010
- aspx.page End Load 0.0427454364881321 0.000697
- aspx.page Begin LoadComplete 0.0427603038348671 0.000015
- aspx.page End LoadComplete 0.0427708262631505 0.000011
- aspx.page Begin PreRender 0.0427806839278941 0.000010
- aspx.page End PreRender 0.0451939911764119 0.002413
- aspx.page Begin PreRenderComplete 0.0452132273970415 0.000019
- aspx.page End PreRenderComplete 0.0452240792126644 0.000011
- aspx.page Begin SaveState 0.0625720689517497 0.017348
- aspx.page End SaveState 0.0720684586668796 0.009496
- aspx.page Begin SaveStateComplete 0.0720922673826682 0.000024
- aspx.page End SaveStateComplete 0.0721030922484179 0.000011
- aspx.page Begin Render 0.0721127432974667 0.000010
- aspx.page End Render 0.0926866508294572 0.020574
NOTE: You can also add custom information to this section of the Trace. Try adding a Trace.Warn("") statement in your code and when that line is executed it will write the text out to the page in Red. This can be very useful for checking execution times of various functions you write.
Control Tree
- Control UniqueID Type Render Size Bytes (including children) ViewState Size Bytes (excluding children) ControlState Size Bytes (excluding children)
- __Page ASP.default_aspx 16551 0 0
- ctl00 ASP.masterpage_master 16551 0 0
- ctl00$ctl08 System.Web.UI.LiteralControl 182 0 0
- ctl00$ctl00 System.Web.UI.HtmlControls.HtmlHead 638 0 0
- ctl00$ctl01 System.Web.UI.HtmlControls.HtmlMeta 43 0 0
- ctl00$ctl02 System.Web.UI.HtmlControls.HtmlMeta 51 0 0
- ctl00$ctl03 System.Web.UI.HtmlControls.HtmlMeta 67 0 0
- ctl00$ctl04 System.Web.UI.HtmlControls.HtmlMeta 66 0 0
- ctl00$ctl05 System.Web.UI.HtmlControls.HtmlMeta 69 0 0
- ctl00$ctl06 System.Web.UI.HtmlControls.HtmlMeta 51 0 0
- ctl00$stMainLayout System.Web.UI.HtmlControls.HtmlLink 114 0 0
- ctl00$stMDSSolutions System.Web.UI.HtmlControls.HtmlLink 118 0 0
- ctl00$ctl07 System.Web.UI.HtmlControls.HtmlTitle 46 0 0
- ctl00$ctl09 System.Web.UI.ResourceBasedLiteralControl 2492 0 0
- aspnetForm System.Web.UI.HtmlControls.HtmlForm 12509 0 0
- ctl00$ctl10 System.Web.UI.LiteralControl 22 0 0
- ctl00$ContentPlaceHolder1 System.Web.UI.WebControls.ContentPlaceHolder 11249 0 0
- ctl00$ContentPlaceHolder1$chkSilverBlog System.Web.UI.WebControls.CheckBox 117 0 0
- ctl00$ContentPlaceHolder1$chkGoldBlog System.Web.UI.WebControls.CheckBox 113 0 0
- ctl00$ContentPlaceHolder1$chkSilverForum System.Web.UI.WebControls.CheckBox 119 0 0
- ctl00$ContentPlaceHolder1$chkGoldForum System.Web.UI.WebControls.CheckBox 115 0 0
- ctl00$ContentPlaceHolder1$chkSilverGallery System.Web.UI.WebControls.CheckBox 123 0 0
- ctl00$ContentPlaceHolder1$chkGoldGallery System.Web.UI.WebControls.CheckBox 119 0 0
- ctl00$ContentPlaceHolder1$chkSilverShop System.Web.UI.WebControls.CheckBox 117 0 0
- ctl00$ContentPlaceHolder1$chkGoldShop System.Web.UI.WebControls.CheckBox 113 0 0
- ctl00$ContentPlaceHolder1$lblSale System.Web.UI.WebControls.Label 119 72 0
- ctl00$ContentPlaceHolder1$btnBronze System.Web.UI.WebControls.ImageButton 187 0 0
- ctl00$ContentPlaceHolder1$btnSilver System.Web.UI.WebControls.ImageButton 187 0 0
- ctl00$ContentPlaceHolder1$btnGold System.Web.UI.WebControls.ImageButton 181 0 0
- ctl00$ContentPlaceHolder1$btnPlatinum System.Web.UI.WebControls.ImageButton 193 0 0
- ctl00$ctl11 System.Web.UI.LiteralControl 18 0 0
- ctl00$ctl12 System.Web.UI.LiteralControl 18 0 0
- ctl00$litUnderForm System.Web.UI.WebControls.Literal 0 0 0
- ctl00$ctl13 System.Web.UI.ResourceBasedLiteralControl 712 0 0
Session State
- Session Key Type Value
Application State
- Application Key Type Value
- '''Request Cookies Collection'''
- Name Value Size
- ReturnURL /epregister/secure/incident/incidentmap.aspx 54
- ASP.NET_SessionId ooj01b55jsm3pbrsuzndjny4 42
- .eprsec F1E78DF9DC6C439D026B006500690074006800000088BC8780C8D9C8010088F069B1CCD9C80100002F000000 96
Response Cookies Collection
- Name Value Size
Headers Collection
- Name Value
- Connection keep-alive
- Keep-Alive 300
- Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
- Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
- Accept-Encoding gzip,deflate
- Accept-Language en-gb,en;q=0.5
- Cookie ReturnURL=/epregister/secure/incident/incidentmap.aspx; ASP.NET_SessionId=ooj01b55jsm3pbrsuzndjny4; .eprsec=F1E78DF9DC6C439D026B006500690074006800000088BC8780C8D9C8010088F069B1CCD9C80100002F000000
- Host localhost:2955
- User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9) Gecko/2008052906 Firefox/3.0
- Response Headers Collection
- Name Value
- X-AspNet-Version 2.0.50727
- Cache-Control public, max-age=3600
- Expires Mon, 30 Jun 2008 21:12:10 GMT
- Last-Modified Mon, 30 Jun 2008 20:12:10 GMT
- Content-Type text/html
Form Collection
- Name Value
Querystring Collection
- Name Value
Server Variables
- Name Value
- ALL_HTTP HTTP_CONNECTION:keep-alive HTTP_KEEP_ALIVE:300 HTTP_ACCEPT:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 HTTP_ACCEPT_CHARSET:ISO-8859-1,utf-8;q=0.7,*;q=0.7 HTTP_ACCEPT_ENCODING:gzip,deflate HTTP_ACCEPT_LANGUAGE:en-gb,en;q=0.5 HTTP_COOKIE:ReturnURL=/epregister/secure/incident/incidentmap.aspx; ASP.NET_SessionId=ooj01b55jsm3pbrsuzndjny4; .eprsec=F1E78DF9DC6C439D026B006500690074006800000088BC8780C8D9C8010088F069B1CCD9C80100002F000000 HTTP_HOST:localhost:2955 HTTP_USER_AGENT:Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9) Gecko/2008052906 Firefox/3.0
- ALL_RAW Connection: keep-alive Keep-Alive: 300 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Accept-Encoding: gzip,deflate Accept-Language: en-gb,en;q=0.5 Cookie: ReturnURL=/epregister/secure/incident/incidentmap.aspx; ASP.NET_SessionId=ooj01b55jsm3pbrsuzndjny4; .eprsec=F1E78DF9DC6C439D026B006500690074006800000088BC8780C8D9C8010088F069B1CCD9C80100002F000000 Host: localhost:2955 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9) Gecko/2008052906 Firefox/3.0
- APPL_MD_PATH
- APPL_PHYSICAL_PATH C:\Documents and Settings\Mark Smith\My Documents\Visual Studio 2005\WebSites\MDSSolutions\
- AUTH_TYPE NTLM
- AUTH_USER MAIN\Mark Smith
- AUTH_PASSWORD
- LOGON_USER MAIN\Mark Smith
- REMOTE_USER MAIN\Mark Smith
- CERT_COOKIE
- CERT_FLAGS
- CERT_ISSUER
- CERT_KEYSIZE
- CERT_SECRETKEYSIZE
- CERT_SERIALNUMBER
- CERT_SERVER_ISSUER
- CERT_SERVER_SUBJECT
- CERT_SUBJECT
- CONTENT_LENGTH 0
- CONTENT_TYPE
- GATEWAY_INTERFACE
- HTTPS
- HTTPS_KEYSIZE
- HTTPS_SECRETKEYSIZE
- HTTPS_SERVER_ISSUER
- HTTPS_SERVER_SUBJECT
- INSTANCE_ID
- INSTANCE_META_PATH
- LOCAL_ADDR 127.0.0.1
- PATH_INFO /MDSSolutions/Default.aspx
- PATH_TRANSLATED C:\Documents and Settings\Mark Smith\My Documents\Visual Studio 2005\WebSites\MDSSolutions\Default.aspx
- QUERY_STRING
- REMOTE_ADDR 127.0.0.1
- REMOTE_HOST 127.0.0.1
- REMOTE_PORT
- REQUEST_METHOD GET
- SCRIPT_NAME /MDSSolutions/Default.aspx
- SERVER_NAME localhost
- SERVER_PORT 2955
- SERVER_PORT_SECURE 0
- SERVER_PROTOCOL HTTP/1.1
- SERVER_SOFTWARE
- URL /MDSSolutions/Default.aspx
- HTTP_CONNECTION keep-alive
- HTTP_KEEP_ALIVE 300
- HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
- HTTP_ACCEPT_CHARSET ISO-8859-1,utf-8;q=0.7,*;q=0.7
- HTTP_ACCEPT_ENCODING gzip,deflate
- HTTP_ACCEPT_LANGUAGE en-gb,en;q=0.5
- HTTP_COOKIE ReturnURL=/epregister/secure/incident/incidentmap.aspx; ASP.NET_SessionId=ooj01b55jsm3pbrsuzndjny4; .eprsec=F1E78DF9DC6C439D026B006500690074006800000088BC8780C8D9C8010088F069B1CCD9C80100002F000000
- HTTP_HOST localhost:2955
- HTTP_USER_AGENT Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9) Gecko/2008052906 Firefox/3.0
- Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
This Hack is part of the ASP.NET Hacks collection



LTD Social Sitings
Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.