Control.Visible 属性
定义
获取或设置一个值,该值指示服务器控件是否作为 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; }
[<System.ComponentModel.Bindable(true)>]
member this.Visible : bool with get, set
Public Overridable Property Visible As Boolean
属性值
如果控件在页上可见,则为 true;否则为 false。true 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. 在这种情况下, false Visible 即使已将属性显式设置为,单独的控件也会返回 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.)