다음을 통해 공유


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)
Available in Sandboxed Solutions: No

Syntax

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

value = instance.IsVisible

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

Property Value

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

Remarks

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

Reference

WebPart Class

WebPart Members

Microsoft.SharePoint.WebPartPages Namespace