WebPart.IsVisible property

NOTE: This API is now obsolete.

Gets or sets whether the Web Part is visible.

Namespace:  Microsoft.SharePoint.WebPartPages
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)


<WebPartStorageAttribute(Storage := Storage.Personal)> _
<ObsoleteAttribute("Use Hidden instead.")> _
Public Property IsVisible As Boolean
Dim instance As WebPart
Dim value As Boolean

value = instance.IsVisible

instance.IsVisible = value
[WebPartStorageAttribute(Storage = Storage.Personal)]
[ObsoleteAttribute("Use Hidden instead.")]
public bool IsVisible { get; set; }

Property value

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


When the IsVisible property is false, the Web Part can still be connected to other Web Parts.

This property differs from System.Web.UI.Control.Visible in that the Web Part is rendered when the IsVisible property is false; however, the Web Part infrastructure will emit a "display:none" style attribute in the rendering to suppress the display of the Web Part.

This property can be personalized by individual users. Its WebPartStorageAttribute value is Storage.Personal, which specifies that the property can be stored on a per-user basis. Only users with the Personalize Web Part pages right can set this property. It can be set programmatically, or it can be set through the Web Part task pane in the personal view of the Web-based user interface, or by using a SharePoint Foundation-compatible HTML editor, such as SharePoint Designer.

Beginning with Windows SharePoint Services 3.0, using this property is the only way to hide a static Web Part (one not in a zone).

See also


WebPart class

WebPart members

Microsoft.SharePoint.WebPartPages namespace