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

備註

控制項狀態是由 Web 服務器控制項需要運作的重要檢視狀態資料所組成的物件;它包含在與一般檢視狀態不同的物件中。

使用控制項狀態的自訂控制項必須先呼叫 方法, RegisterRequiresControlState 才能儲存控制項狀態。 RequiresControlState使用 方法來檢查向頁面註冊的控制項,因為需要控制項狀態。

適用於

另請參閱