Control.Visible Control.Visible Control.Visible Control.Visible Property

定义

获取或设置一个值,该值指示服务器控件是否作为 UI 呈现在页上。Gets or sets a value that indicates whether a server control is rendered as UI on the page.

public:
 virtual property bool Visible { bool get(); void set(bool value); };
[System.ComponentModel.Bindable(true)]
public virtual bool Visible { get; set; }
member this.Visible : bool with get, set
Public Overridable Property Visible As Boolean

属性值

如果控件在页上可见,则为 true;否则为 falsetrue if the control is visible on the page; otherwise false.

注解

如果此属性为false,则不会呈现服务器控件。If this property is false, the server control is not rendered. 组织页面布局时,应考虑到这一点。You should take this into account when organizing the layout of your page.

备注

如果未呈现容器控件,则即使将单个控件的Visible属性设置为true,也不会呈现它包含的任何控件。If a container control is not rendered, any controls that it contains will not be rendered even if you set the Visible property of an individual control to true. 在这种情况下,即使已falseVisible属性显式设置为true,单独的控件也会返回。In that case, the individual control returns false for the Visible property even if you have explicitly set it to true. (也就是说,如果Visible父控件的属性设置为false,则子控件继承该设置,该设置优先于任何本地设置。)(That is, if the Visible property of the parent control is set to false, the child control inherits that setting and the setting takes precedence over any local setting.)

适用于