語言

Page.RequiresControlState(Control) 方法

定義

判斷指定 Control 物件是否註冊參與控制狀態管理。

public:
 bool RequiresControlState(System::Web::UI::Control ^ control);
public bool RequiresControlState(System.Web.UI.Control control);
member this.RequiresControlState : System.Web.UI.Control -> bool
Public Function RequiresControlState (control As Control) As Boolean

參數

control
Control

檢查 Control 是否有控制狀態要求。

傳回

true若指定Control條件要求控制狀態;否則,。 false

備註

控制狀態是一個由關鍵視圖狀態資料組成的物件,網頁伺服器控制必須用這些資料才能運作;它被包含在與正常視圖狀態不同的物件中。

使用控制狀態的自訂控制必須在儲存控制狀態前呼叫該 RegisterRequiresControlState 方法。 使用該 RequiresControlState 方法檢查頁面註冊為需要控制狀態的控制項。

適用於

另請參閱