asp.net中,可通過在<system.web>元素節點下啟用<trace>節點元素來啟用訪問跟蹤的。其資訊的詳細程度,另人吃驚:包括整個請求的過程、請求參數和回傳值(viewstate)
system.web.trace <!-- 啟用訪問跟蹤,此資訊非常詳細,可看到整個訪問的全部過程及其中參數的傳遞。
requestLimit: 跟蹤資源限制數
mostRecent: 是否保留最近的跟蹤資源,與requestLimit搭配使用。如下,mostRecent為false時,則跟蹤資源數為5時,
則不在進行記錄跟蹤了,反之保持最新的5個
pageOutput: 是否跟蹤資訊在每個頁面上都顯示 false則不顯示,可通過訪問 ${web root path}/trace.axd來查看
-->
<trace enabled="true" requestLimit="5" mostRecent="true" pageOutput="false"/>
啟用trace元素後,則可查看訪問跟蹤的資訊
| ajax1 |
| [ 清除當前跟蹤 ] |
| 物理目錄:D:"project"net"vs2005"webapp"ajax1" |
| 對此應用程式的請求 |
剩餘: 0 |
| 編號 |
請求的時間 |
檔案 |
狀態碼 |
謂詞 |
|
| 1 |
2008-8-3 1:56:46 |
/a.gif |
200 |
GET |
查看詳細資料 |
| 2 |
2008-8-3 1:56:47 |
/multiUpdateProgress.aspx |
200 |
POST |
查看詳細資料 |
| 3 |
2008-8-3 1:57:09 |
/updateProgress1.aspx |
200 |
GET |
查看詳細資料 |
| 4 |
2008-8-3 1:57:09 |
/a.gif |
200 |
GET |
查看詳細資料 |
| 5 |
2008-8-3 1:57:11 |
/updateProgress1.aspx |
200 |
POST |
查看詳細資料 |
Microsoft .NET Framework 版本:2.0.50727.1433; ASP.NET 版本:2.0.50727.1433
通過點擊後面的 查看詳細資料,可觀看到對該頁面的詳細跟蹤過程的。
請求詳細資料
| 請求詳細資料 |
| 會話 ID: |
|
請求類型: |
POST |
| 請求的時間: |
2008-8-3 1:56:47 |
狀態碼: |
200 |
| 請求編碼: |
Unicode (UTF-8) |
響應編碼: |
Unicode (UTF-8) |
| 跟蹤資訊 |
| 類別 |
訊息 |
From First(s) |
From Last(s) |
| aspx.page |
Begin PreInit |
|
|
| aspx.page |
End PreInit |
5.6711118312523E-05 |
0.000057 |
| aspx.page |
Begin Init |
9.21904878972048E-05 |
0.000035 |
| aspx.page |
End Init |
0.00159489544062164 |
0.001503 |
| aspx.page |
Begin InitComplete |
0.00163512401715861 |
0.000040 |
| aspx.page |
End InitComplete |
0.00166976529139877 |
0.000035 |
| aspx.page |
Begin LoadState |
0.00169853989822729 |
0.000029 |
| aspx.page |
End LoadState |
0.0242374379984048 |
0.022539 |
| aspx.page |
Begin ProcessPostData |
0.0242988983236696 |
0.000061 |
| aspx.page |
End ProcessPostData |
0.0302901625765286 |
0.005991 |
| aspx.page |
Begin PreLoad |
0.0303382133762811 |
0.000048 |
| aspx.page |
End PreLoad |
0.0303683848086838 |
0.000030 |
| aspx.page |
Begin Load |
0.0303963213201678 |
0.000028 |
| aspx.page |
End Load |
0.0304348737060157 |
0.000039 |
| aspx.page |
Begin ProcessPostData Second Try |
0.0304636483128442 |
0.000029 |
| aspx.page |
End ProcessPostData Second Try |
0.0305063911754148 |
0.000043 |
| aspx.page |
Begin Raise ChangedEvents |
0.0305334895915542 |
0.000027 |
| aspx.page |
End Raise ChangedEvents |
0.0311260230001299 |
0.000593 |
| aspx.page |
Begin Raise PostBackEvent |
0.0311648547510927 |
0.000039 |
| aspx.page |
End Raise PostBackEvent |
3.04188549103308 |
3.010721 |
| aspx.page |
Begin LoadComplete |
3.04195253866064 |
0.000067 |
| aspx.page |
End LoadComplete |
3.04198326882327 |
0.000031 |
| aspx.page |
Begin PreRender |
3.04201148469987 |
0.000028 |
| aspx.page |
End PreRender |
3.04320800548673 |
0.001197 |
| aspx.page |
Begin PreRenderComplete |
3.04325158644465 |
0.000044 |
| aspx.page |
End PreRenderComplete |
3.04770271081939 |
0.004451 |
| aspx.page |
Begin SaveState |
3.04888666017608 |
0.001184 |
| aspx.page |
End SaveState |
3.04902885701954 |
0.000142 |
| aspx.page |
Begin SaveStateComplete |
3.04906266019843 |
0.000034 |
| aspx.page |
End SaveStateComplete |
3.0490959046471 |
0.000033 |
| aspx.page |
Begin Render |
3.04912328242835 |
0.000027 |
| aspx.page |
End Render |
3.14082544010482 |
0.091702 |
| 控制項樹 |
| 控制項 UniqueID |
類型 |
呈現大小位元組數(包括子級) |
ViewState 大小位元組數(不包括子級) |
ControlState 大小位元組(不包括子級) |
| __Page |
ASP.multiupdateprogress_aspx |
1019 |
0 |
0 |
| ctl06 |
System.Web.UI.LiteralControl |
0 |
0 |
0 |
| ctl00 |
System.Web.UI.HtmlControls.HtmlHead |
0 |
0 |
0 |
| ctl01 |
System.Web.UI.HtmlControls.HtmlTitle |
0 |
0 |
0 |
| ctl07 |
System.Web.UI.LiteralControl |
0 |
0 |
0 |
| form1 |
System.Web.UI.HtmlControls.HtmlForm |
0 |
0 |
0 |
| ctl08 |
System.Web.UI.LiteralControl |
0 |
0 |
0 |
| ScriptManager1 |
System.Web.UI.ScriptManager |
0 |
0 |
0 |
| ctl09 |
System.Web.UI.LiteralControl |
0 |
0 |
0 |
| UpdatePanel1 |
System.Web.UI.UpdatePanel |
0 |
0 |
0 |
| ctl02 |
System.Web.UI.Control |
0 |
0 |
0 |
| ctl10 |
System.Web.UI.LiteralControl |
0 |
0 |
0 |
| UpdateProgress1 |
System.Web.UI.UpdateProgress |
0 |
0 |
0 |
| ctl04 |
System.Web.UI.Control |
0 |
0 |
0 |
| ctl11 |
System.Web.UI.LiteralControl |
0 |
0 |
0 |
| ctl12 |
System.Web.UI.LiteralControl |
0 |
0 |
0 |
| Label1 |
System.Web.UI.WebControls.Label |
0 |
28 |
0 |
| ctl13 |
System.Web.UI.LiteralControl |
0 |
0 |
0 |
| Button1 |
System.Web.UI.WebControls.Button |
0 |
0 |
0 |
| ctl14 |
System.Web.UI.LiteralControl |
0 |
0 |
0 |
| ctl15 |
System.Web.UI.LiteralControl |
0 |
0 |
0 |
| UpdatePanel2 |
System.Web.UI.UpdatePanel |
0 |
0 |
0 |
| ctl03 |
System.Web.UI.Control |
0 |
0 |
0 |
| ctl16 |
System.Web.UI.LiteralControl |
0 |
0 |
0 |
| UpdateProgress2 |
System.Web.UI.UpdateProgress |
0 |
0 |
0 |
| ctl05 |
System.Web.UI.Control |
0 |
0 |
0 |
| ctl17 |
System.Web.UI.LiteralControl |
0 |
0 |
0 |
| ctl18 |
System.Web.UI.LiteralControl |
0 |
0 |
0 |
| Label2 |
System.Web.UI.WebControls.Label |
0 |
28 |
0 |
| ctl19 |
System.Web.UI.LiteralControl |
0 |
0 |
0 |
| Button2 |
System.Web.UI.WebControls.Button |
0 |
0 |
0 |
| ctl20 |
System.Web.UI.LiteralControl |
0 |
0 |
0 |
| ctl21 |
System.Web.UI.LiteralControl |
0 |
0 |
0 |
| ctl22 |
System.Web.UI.LiteralControl |
0 |
0 |
0 |
| 標題集合 |
| 名稱 |
值 |
| Cache-Control |
no-cache, no-cache |
| Connection |
keep-alive |
| Keep-Alive |
300 |
| Pragma |
no-cache |
| Content-Length |
326 |
| Content-Type |
application/x-www-form-urlencoded; charset=UTF-8 |
| Accept |
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 |
| Accept-Charset |
gb2312,utf-8;q=0.7,*;q=0.7 |
| Accept-Encoding |
gzip,deflate |
| Accept-Language |
zh-cn,zh;q=0.5 |
| Host |
localhost:3764 |
| Referer |
http://localhost:3764/ajax1/multiUpdateProgress.aspx |
| User-Agent |
Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1 |
| X-MicrosoftAjax |
Delta=true |
| 表單集合 |
| 名稱 |
值 |
| ScriptManager1 |
UpdatePanel2|Button2 |
| __EVENTTARGET |
|
| __EVENTARGUMENT |
|
| __VIEWSTATE |
/wEPDwUKMTc4Nzk0NDQ3Mw9kFgICAw9kFgQCAw9kFgJmD2QWAgIDDw8WAh4EVGV4dAUHMTo1Njo0NWRkAgUPZBYCZg9kFgICAw8PFgIfAAUHMTo1Njo0NWRkZNM9cZI4DDrWJpktacZYTXXli5TV |
| __EVENTVALIDATION |
/wEWAwLFh/qTCAKM54rGBgK7q7GGCHjYIOQqzURROBMZ6gMnx1sO/AgX |
| Button2 |
Button |
| 伺服器變數 |
| 名稱 |
值 |
| ALL_HTTP |
HTTP_CACHE_CONTROL:no-cache, no-cache HTTP_CONNECTION:keep-alive HTTP_KEEP_ALIVE:300 HTTP_PRAGMA:no-cache HTTP_CONTENT_LENGTH:326 HTTP_CONTENT_TYPE:application/x-www-form-urlencoded; charset=UTF-8 HTTP_ACCEPT:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 HTTP_ACCEPT_CHARSET:gb2312,utf-8;q=0.7,*;q=0.7 HTTP_ACCEPT_ENCODING:gzip,deflate HTTP_ACCEPT_LANGUAGE:zh-cn,zh;q=0.5 HTTP_HOST:localhost:3764 HTTP_REFERER:http://localhost:3764/ajax1/multiUpdateProgress.aspx HTTP_USER_AGENT:Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1 HTTP_X_MICROSOFTAJAX:Delta=true |
| ALL_RAW |
Cache-Control: no-cache, no-cache Connection: keep-alive Keep-Alive: 300 Pragma: no-cache Content-Length: 326 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Charset: gb2312,utf-8;q=0.7,*;q=0.7 Accept-Encoding: gzip,deflate Accept-Language: zh-cn,zh;q=0.5 Host: localhost:3764 Referer: http://localhost:3764/ajax1/multiUpdateProgress.aspx User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1 X-MicrosoftAjax: Delta=true |
| APPL_MD_PATH |
|
| APPL_PHYSICAL_PATH |
D:"project"net"chqapp"vs2005"webapp"ajax1" |
| AUTH_TYPE |
|
| AUTH_USER |
|
| AUTH_PASSWORD |
|
| LOGON_USER |
HQM-CHQ"Administrator |
| REMOTE_USER |
|
| CERT_COOKIE |
|
| CERT_FLAGS |
|
| CERT_ISSUER |
|
| CERT_KEYSIZE |
|
| CERT_SECRETKEYSIZE |
|
| CERT_SERIALNUMBER |
|
| CERT_SERVER_ISSUER |
|
| CERT_SERVER_SUBJECT |
|
| CERT_SUBJECT |
|
| CONTENT_LENGTH |
326 |
| CONTENT_TYPE |
application/x-www-form-urlencoded; charset=UTF-8 |
| 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 |
/ajax1/multiUpdateProgress.aspx |
| PATH_TRANSLATED |
D:"project"net"chqapp"vs2005"webapp"ajax1"multiUpdateProgress.aspx |
| QUERY_STRING |
|
| REMOTE_ADDR |
127.0.0.1 |
| REMOTE_HOST |
127.0.0.1 |
| REMOTE_PORT |
|
| REQUEST_METHOD |
POST |
| SCRIPT_NAME |
/ajax1/multiUpdateProgress.aspx |
| SERVER_NAME |
localhost |
| SERVER_PORT |
3764 |
| SERVER_PORT_SECURE |
0 |
| SERVER_PROTOCOL |
HTTP/1.1 |
| SERVER_SOFTWARE |
|
| URL |
/ajax1/multiUpdateProgress.aspx |
| HTTP_CACHE_CONTROL |
no-cache, no-cache |
| HTTP_CONNECTION |
keep-alive |
| HTTP_KEEP_ALIVE |
300 |
| HTTP_PRAGMA |
no-cache |
| HTTP_CONTENT_LENGTH |
326 |
| HTTP_CONTENT_TYPE |
application/x-www-form-urlencoded; charset=UTF-8 |
| HTTP_ACCEPT |
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 |
| HTTP_ACCEPT_CHARSET |
gb2312,utf-8;q=0.7,*;q=0.7 |
| HTTP_ACCEPT_ENCODING |
gzip,deflate |
| HTTP_ACCEPT_LANGUAGE |
zh-cn,zh;q=0.5 |
| HTTP_HOST |
localhost:3764 |
| HTTP_REFERER |
http://localhost:3764/ajax1/multiUpdateProgress.aspx |
| HTTP_USER_AGENT |
Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1 |
| HTTP_X_MICROSOFTAJAX |
Delta=true |
Microsoft .NET Framework 版本:2.0.50727.1433; ASP.NET 版本:2.0.50727.1433