Page頁面是用控件樹的形式來組織的
如圖
page
+--controls[0]
+-----controls[0].controls
+--controls[1]
+-----controls[1].controls
比如頁面上只有兩個DataGrid
那麼controls[0].controls是第一個DataGrid裏面的所有子控件
controls[1].controls是第二個DataGrid裏面的所有子控件
在page指令種添加如下內容可以看到控件樹!
<%@ Page language= "c# " Codebehind= "WebForm1.aspx.cs " AutoEventWireup= "false " Trace= "true "
添加:
Trace= "true "就可以了!