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 控件状态要求。

返回

如果指定 需要控制状态,则为

注解

控件状态是由 Web 服务器控件需要正常运行的关键视图状态数据构成的对象;它包含在与普通视图状态不同的对象中。

使用控件状态的 RegisterRequiresControlState 自定义控件在保存控件状态之前必须调用该方法。 使用该方法 RequiresControlState 检查在页面注册的控件是否为需要控件状态。

适用于

另请参阅