Gets or sets a value indicating whether a WebPart control is displayed on a Web page.
Assembly: System.Web (in System.Web.dll)
[<PersonalizableAttribute>] [<ThemeableAttribute(false)>] abstract Hidden : bool with get, set [<PersonalizableAttribute>] [<ThemeableAttribute(false)>] override Hidden : bool with get, set
A WebPart control that is hidden remains in its zone, is actually rendered on its page, and participates in page life cycle phases such as the PreRender phase, even though it is not visible in a browser. This is different from WebPart controls that are closed, because closed controls are not even rendered on a page, while hidden controls are rendered and active in Web Parts applications, though not visible to users. The Web Parts control set hides the WebPart control by setting its cascading style sheet (CSS) style to a value of display:none.
Even if the property for a control is set to true, the control is still displayed if the current display mode on the page allows hidden controls to be displayed. For example, edit mode allows hidden controls to be displayed, so that users can edit them. When hidden controls are visible in certain display modes, the title of the control displays a string indicating that the control is in hidden status.
When the property on a WebPart control is set to false, which is the default, the control is displayed on the page. Note that if the AllowHide property is set to false, end users are not allowed to edit the property value.
The following code example demonstrates the use of the property for a custom Web Parts control. This example assumes the use of a custom control, TextDisplayWebPart, which is found in the Example section of the WebPart class overview.
Notice that in the Web page, in the declarative markup for the <aspSample:TextDisplayWebPart> element, the Hidden attribute value is set to true. The TextDisplayWebPart control will not appear if the page is loaded in a browser. However, the control is still present on the page and in its zone, and it still could participate in connections with other WebPart controls if you created those connections.
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.