Export (0) Print
Expand All

View.Visible Property

Gets or sets a value that indicates whether the View control is visible.

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

[BrowsableAttribute(false)]
public override bool Visible { get; set; }
<asp:View Visible="True|False" />

Property Value

Type: System.Boolean
true if the View control is visible; otherwise, false. The default value is false.

ExceptionCondition
InvalidOperationException

An attempt was made to set this property at run time.

Use the Visible property to determine whether the current View control is visible and rendered to the client. For a View control to be visible on the rendered page, it must be the active view in its containing MultiView control, and the containing MultiView control must be visible. If the containing MultiView control is not visible on the page, or if the View control is not the active view, then the View control and its child controls are not rendered.

NoteNote

The Visible property is set internally based on the visibility and active view for the containing parent control. If you set this property at run time, an InvalidOperationException exception is thrown. If you set the Visible property at design time, any changes to the property are ignored.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft