System.Web.UI.WebControls.WebParts.WebPart.AllowClose Property

Gets or sets a value indicating whether an end user can close a System.Web.UI.WebControls.WebParts.WebPart control on a Web page.

Syntax

public virtual bool AllowClose { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

After a user closes a System.Web.UI.WebControls.WebParts.WebPart control on a Web page, the control is no longer visible or available on the page. The closed control is added to the page catalog, a Web Parts entity that stores a reference to the control. If a developer adds a System.Web.UI.WebControls.WebParts.PageCatalogPart control to the page within a System.Web.UI.WebControls.WebParts.CatalogZone control, users are able to switch the page to catalog display mode, select the closed control in the page catalog, and add it back to the page.

Note:

A closed System.Web.UI.WebControls.WebParts.WebPart control can be added back to a page either programmatically, or by a user who selects the closed control from the page catalog when the page is in catalog display mode.

Closing a System.Web.UI.WebControls.WebParts.WebPart control is different from deleting it. A closed control can be added back to a page, while a deleted control is permanently removed. For more information on deleting controls, see the WebPartManager.DeleteWebPart(WebPart) method. Closing a control is also different from hiding it. A control that is hidden is still present on the page, still participates in page life cycle events, and is only hidden from the user's view, but a closed control is not even rendered on a page.

Both static and dynamic System.Web.UI.WebControls.WebParts.WebPart controls (static controls are declared in a page's markup, while dynamic controls are added programmatically) can be closed.

If a developer sets the WebPart.AllowClose property to false, a close verb does not appear on the control, and the user is not able to close the control.

This property cannot be set by themes or style sheet themes. For more information, see System.Web.UI.ThemeableAttribute and ASP.NET Themes Overview.

The personalization scope of this property is set to PersonalizationScope.Shared and can be modified only by authorized users. For more information, see System.Web.UI.WebControls.WebParts.PersonalizableAttribute and Web Parts Personalization Overview.

Requirements

Namespace: System.Web.UI.WebControls.WebParts
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0