System.Web
2.0.0.0
System.Web.UI.WebControls.WebParts.Part
System.Web.UI.WebControls.WebParts.IWebActionable
System.Web.UI.WebControls.WebParts.IWebPart
When you create controls with Web Parts functionality, you have two basic options. You can create custom controls that derive from the class, or you can create or use other server controls. Existing ASP.NET controls, custom server controls, and user controls can all be given full Web Parts functionality by declaring them within (or adding them programmatically to) a zone control, with the result that they will be wrapped with objects at run time and treated as true controls. For details, see the documentation for the class. For speed of development and maximum reuse of code, using existing server controls can be a good option. For maximum programmatic control over the behavior and Web Parts functionality of controls, creating a custom control that inherits from the class is often the best option.
The abstract class inherits from the base control and provides the basic elements for all controls. The class includes a common set of properties that affect the appearance of the UI. The , , , , , and properties each specify whether the user of a Web application is permitted to interact with the part control in the way indicated by the given property name. The , , , , , , , , , , and properties determine the size, visibility, appearance, and supporting content (such as a title and a description) for a control.
The relationship of a control to its context within the Web Parts control set is determined by properties such as , which holds a reference to the control's associated object, and , which references the that contains the control. There can be only one control per page, and each instance of a control can reside within only one at a time.
A control can be placed outside of a zone on a Web page, but in this case it functions as a normal server control and loses nearly all Web Parts functionality.
Several other important properties affect unique features of controls. The property allows developers to set an arbitrary string that can be used as a filter at run time to determine whether a control is added to the page. Used together with a feature such as role management, the property provides a useful mechanism for creating views based on defined user roles. The property indicates whether, during an export, all the available property data on a control is exported, or only the non-sensitive data. This allows developers to distinguish between data that is sensitive and data that is not, for security purposes. The property returns a reference to an instance of a control, so that an control can edit it when the page is in edit mode. Finally, there are several properties that indicate the status of the control relative to the rest of the page. The property indicates whether a control is closed (and thus added to a object), or if it is open and available on the page. The property indicates whether a control is a shared control (versus a user-specific control), meaning that it is visible to all users of a Web page. The property indicates whether a control is currently contained in a -derived zone (such as ). A value of false indicates the control is inside a zone and thus has full Web Parts functionality. The property indicates whether a control is static or dynamic. A static control is declared in the markup of a Web page, whereas a dynamic control is added programmatically.
The class also provides several methods that determine what happens at various points in the control's life cycle. For example, the and methods can both be overridden in a derived class to provide programmatic control over the rendering of a control's contents during the event that corresponds to each method's name.
Classes that derive from can add objects to the collection. The verbs are rendered in a verbs menu, which appears in the title bar of a control. objects provide simple UI elements for common user actions such as hiding or minimizing the control or displaying Help.
The method creates a collection of any custom controls that are associated with a control. Developers can override this method so that it creates custom controls designed specifically to edit their control. The method is called when a user clicks the edit verb on a control.
Serves as the base class for custom ASP.NET Web Parts controls, adding to the base class features some additional user interface (UI) properties, the ability to create connections, and personalization behavior.
Constructor
The constructor initializes default values for several UI-oriented properties, including the various Allow properties that determine the control's capabilities. These properties are then incorporated into an inherited class instance.
Initializes the class for use by an inherited class instance. This constructor can only be called by an inherited class.
2.0.0.0
Property
System.Boolean
To be added.
After a user closes a 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 control to the page within a 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.
A closed 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 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 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 controls (static controls are declared in a page's markup, while dynamic controls are added programmatically) can be closed.
If a developer sets the 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 and ASP.NET Themes Overview.
The personalization scope of this property is set to and can be modified only by authorized users. For more information, see and Web Parts Personalization Overview.
Gets or sets a value indicating whether an end user can close a control on a Web page.
2.0.0.0
Property
System.Boolean
To be added.
The property value can be set declaratively in page markup, or programmatically.
This property cannot be set by themes or style sheet themes. For more information, see and ASP.NET Themes Overview.
The personalization scope of this property is set to and can be modified only by authorized users. For more information, see and Web Parts Personalization Overview.
Gets or sets a value that indicates whether the control allows other controls to form connections with it.
2.0.0.0
Property
System.Boolean
To be added.
To allow end users to edit a control, the property must be set to true (the default), and the page's display mode must be in edit mode. Display modes are represented by fields in the control. In this case, the mode is . For details about page display modes and how to change them, see the class overview.
When the property is set to false either declaratively or programmatically, editing options are limited. The only possible editing operations are changes to the page's layout, using a control, or other basic operations enabled through custom controls.
For an example that uses controls from the Web Parts control set and shows how to enable editing of a custom Web Parts control, see Walkthrough: Creating a Web Parts Page.
The effect that the property has on a control's behavior is also impacted by the current personalization scope of the Web page, and the individual Web Parts controls on that page. For more information, see Web Parts Personalization Overview.
This property cannot be set by themes or style sheet themes. For more information, see and ASP.NET Themes Overview.
The personalization scope of this property is set to and can be modified only by authorized users. For more information, see and Web Parts Personalization Overview.
Gets or sets a value indicating whether an end user can modify a control through the user interface (UI) provided by one or more controls.
2.0.0.0
Property
System.Boolean
To be added.
The property determines whether users can modify the property. In the default case, when the property value is true, users can change the value when the control is being edited. By default, controls are not hidden and their property value is false. When a control is being edited, if a user selects a check box to hide the control (which sets the property to true), the control will no longer be visible when the page returns to browse mode.
Hidden controls are distinct from controls that are closed, because the property has a distinct meaning within the Web Parts control set. Closed controls are not even rendered on a page, and do not participate in page life cycle events. In contrast, while hidden controls are not visible to users, they are still rendered on a Web page, are still contained in a zone, and can still maintain connections with other controls as part of a Web Parts application.
This property cannot be set by themes or style sheet themes. For more information, see and ASP.NET Themes Overview.
The personalization scope of this property is set to and can be modified only by authorized users. For more information, see and Web Parts Personalization Overview.
Gets or sets a value indicating whether end users are allowed to hide a control.
2.0.0.0
Property
System.Boolean
To be added.
The property, if set to false, prevents an end user from being able to minimize the control, and the user interface (UI) for minimizing the control does not appear in the control's title bar. In Web Parts terminology, when the property is set to false, the minimize verb does not appear on the control's verbs menu.
When a user minimizes a control, it reduces the control's size down to a minimal area that displays only part of the control's title bar and title.
This property cannot be set by themes or style sheet themes. For more information, see and ASP.NET Themes Overview.
The personalization scope of this property is set to and can be modified only by authorized users. For more information, see and Web Parts Personalization Overview.
Gets or sets a value indicating whether end users can minimize a control.
2.0.0.0
Property
System.Boolean
To be added.
When the property is true, and a Web page is in a display mode that allows layout changes (such as edit or design mode), a user can change the page layout by moving a control to another zone on the page. If the property is set to false, a control cannot be moved between zones, but can still be moved within its current zone.
This property cannot be set by themes or style sheet themes. For more information, see and ASP.NET Themes Overview.
The personalization scope of this property is set to and can be modified only by authorized users. For more information, see and Web Parts Personalization Overview.
Gets or sets a value indicating whether a user can move a control between zones.
2.0.0.0
Property
System.String
To be added.
The Web Parts control set does not implement any default behavior for the property. However, the property is provided so that you can assign an arbitrary string value to a custom control; this property can be checked by the control during its event to determine whether the control can be added to the page.
In some cases, the property might be used with the ASP.NET role manager feature, so that if a user is in a certain role, and if the string value of the property meets certain conditions set by the developer, then the control can be added. This approach allows developers to create custom views of a page based on a combination of roles and other authorization criteria that they specify.
This property cannot be set by themes or style sheet themes. For more information, see and ASP.NET Themes Overview.
The personalization scope of this property is set to and can be modified only by authorized users. For more information, see and Web Parts Personalization Overview.
Gets or sets an arbitrary string to determine whether a control is authorized to be added to a page.
2.0.0.0
Property
System.String
To be added.
The personalization scope of this property is set to and can be modified only by authorized users. For more information, see and Web Parts Personalization Overview.
Gets or sets the URL to an image that represents a Web Parts control in a catalog of controls.
2.0.0.0
Property
System.Web.UI.WebControls.WebParts.PartChromeState
To be added.
A part control's property value can be normal or minimized. The class overrides the base property so that end users can personalize it.
For a code example that uses this property, see the base property.
Gets or sets whether a part control is in a minimized or normal state.
2.0.0.0
Property
System.Web.UI.WebControls.WebParts.PartChromeType
To be added.
A part control's property determines what kind of border surrounds the control. Options include showing a title only, a border only, a title and border, neither, or the default option, which simply uses the value of the property.
The class overrides the base property so that end users can personalize it.
For a code example that uses this property, see the base property.
Gets or sets the type of border that frames a Web Parts control.
2.0.0.0
Property
System.String
To be added.
The content of the property is supplied internally by the Web Parts control set.
Gets an error message to display to users if errors occur during the connection process.
2.0.0.0
Property
System.String
To be added.
The property is typically a string that is used in catalogs that provide lists of part controls, and as a ToolTip in the part control's title bar. The content of the property appears in a ToolTip when you position your mouse pointer over the title text in a part control's title bar. The ToolTip text is created from the value of the property, followed by a hyphen, followed by the property value.
For a code example that uses this property, see the base property.
The personalization scope of this property is set to and can be modified only by authorized users. For more information, see and Web Parts Personalization Overview.
Gets or sets a brief phrase that summarizes what the part control does, for use in ToolTips and catalogs of part controls.
2.0.0.0
Property
System.Web.UI.WebControls.ContentDirection
To be added.
The class overrides the base property values so that ends users can personalize the property.
Gets or sets the horizontal direction that content flows within the control.
2.0.0.0
Property
System.String
To be added.
The property returns either the current value of the property or, if the control has no title, a calculated value. The calculated value consists of a localizable resource string for untitled controls, plus (if there are multiple controls within the zone) a number based on the index of the control within the zone.
For custom controls where the property has been overridden to return a string value to use as a subtitle, the property is concatenated with the subtitle to produce a complete title.
The property value also serves as part of a ToolTip that appears when a user positions the mouse pointer over the title bar of a control. The full ToolTip consists of the value, followed by a hyphen, followed by the value of the control's property.
Gets a string that contains the full title text actually displayed in the title bar of a control instance.
2.0.0.0
Property
System.Web.UI.WebControls.WebParts.WebPartExportMode
To be added.
By default, a control cannot be exported and its property is set to . To enable exporting all properties for the control, set the value to . To export only certain properties while preventing the export of properties that contain sensitive data, you set the property value to .
To export property value descriptions for a control, the properties must also be marked with the Personalizable attribute in the metadata for the property's source code. For details, see .
To enable the export feature for a Web application that includes Web Parts controls, in the Web.config file for your application, you must add an attribute to the <webParts> element within the <system.web> section, as in the following markup.
<webParts enableExport="true">
</webParts>
This property cannot be set by themes or style sheet themes. For more information, see and ASP.NET Themes Overview.
The personalization scope of this property is set to and can be modified only by authorized users. For more information, see and Web Parts Personalization Overview.
Gets or sets whether all, some, or none of a control's properties can be exported.
2.0.0.0
Property
System.Boolean
To be added.
This property refers to personalization data that is set on a control in shared scope, meaning personalization data that is seen by all users.
Gets a value that indicates whether a control has any shared personalization data associated with it.
2.0.0.0
Property
System.Boolean
To be added.
This property refers to custom personalization data that is user-specific -- in other words, specific settings by a user on a control that are visible only to that user.
Gets a value that indicates whether a control has any user personalization data associated with it.
2.0.0.0
Property
System.Web.UI.WebControls.Unit
To be added.
Internet Explorer rendering modes can affect the height of a control and the height of the zone that contains it. Internet Explorer renders Web pages either in compatibility mode (backward compatible with previous browser versions) or in standards mode (determined by the presence of a DOCTYPE declaration in the page). For information about these modes, see the DHTML compatMode property.
When Internet Explorer renders a page in standards mode, under some circumstances it might not resize cells in tables, even when a cell's HTML markup is <td height="100%">. As a result, controls and their containing zone are rendered so that the controls do not stretch to the full height of the zone.
When Internet Explorer is in standard mode, controls do not render to stretch to their full height in the following cases:
-
When a zone's property is set to and you explicitly set the height on the zone. To enable controls to fill the full height of the zone, do not specify the height of a horizontally oriented zone.
-
When a zone's property is set to and you do not explicitly set the height of the zone or of the contained controls. To enable controls to fill the full height of the zone, set the height of the zone or of the controls in a vertically oriented zone.
Gets or sets the height of a zone.
2.0.0.0
Property
System.Web.UI.WebControls.WebParts.WebPartHelpMode
To be added.
Use the property to determine how a browser will display Help content for a control. The following table lists the effects of the various Help modes on a browser when Help content for a control is displayed.
-
Help mode
Browser behavior
-
Opens a separate browser window, if the browser has this capability. A user must close the window before returning to the Web Parts page.
-
Opens a separate browser window, if the browser has this capability. A user does not have to close the window before returning to the Web page.
-
Replaces the Web Parts page in the browser window.
This property cannot be set by themes or style sheet themes. For more information, see and ASP.NET Themes Overview.
The personalization scope of this property is set to and can be modified only by authorized users. For more information, see and Web Parts Personalization Overview.
Gets or sets the type of user interface (UI) used to display Help content for a control.
2.0.0.0
Property
System.String
To be added.
To enable a verb menu with a help verb in the verbs menu of a control, you must provide a value for the property. The manner in which the Help content is displayed in the browser is determined by the value of the property.
This property cannot be set by themes or style sheet themes. For more information, see and ASP.NET Themes Overview.
The personalization scope of this property is set to and can be modified only by authorized users. For more information, see and Web Parts Personalization Overview.
Gets or sets the URL to a Help file for a control.
2.0.0.0
Property
System.Boolean
To be added.
A 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 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 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 control is set to false, which is the default, the control is displayed on the page. Note that if the property is set to false, end users are not allowed to edit the property value.
This property cannot be set by themes or style sheet themes. For more information, see and ASP.NET Themes Overview.
Gets or sets a value indicating whether a control is displayed on a Web page.
2.0.0.0
Property
System.String
To be added.
The property allows you to set a custom error message that is displayed if an error occurs when a user tries to import a part control's description file into a catalog of Web Parts controls. You can set the property declaratively on a control, adding the ImportErrorMessage attribute within the opening tag of the control and assigning an error message string to it. You can also set the property value programmatically.
For a full code example that demonstrates both exporting and importing .WebPart description files for controls, which includes use of the property, see the class.
The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see and ASP.NET Globalization and Localization.
The personalization scope of this property is set to and can be modified only by authorized users. For more information, see and Web Parts Personalization Overview.
Gets or sets an error message that is used if errors occur when a control is imported.
2.0.0.0
Property
System.Boolean
To be added.
A control that is closed is not rendered on the page and does not participate in page events. However, it is maintained in a page catalog by the Web Parts application, and can be added back to the page by users if the appropriate user interface (UI) is provided. For more information, see .
Gets a value that indicates whether a control is currently closed on a Web Parts page.
2.0.0.0
Property
System.Boolean
To be added.
A shared Web Parts control is visible to all users of a Web page. The opposite of a shared control is a per-user control, which is user-specific and is visible only to the user who added that control to a page.
If a dynamic control is added while a user is viewing the page in shared personalization scope, the control will be shared. If the control is added while the user is in user personalization scope, the property value for that control will be false.
For more information about shared and per-user controls, see Web Parts Personalization.
Gets a value that indicates whether a control is shared, meaning that it is visible to all users of a Web Parts page.
2.0.0.0
Property
System.Boolean
To be added.
To be added.
Gets a value that indicates whether a control is standalone, meaning that it is not contained within a zone.
2.0.0.0
Property
System.Boolean
To be added.
A static control is one that is declared in the markup of a Web Parts page. This contrasts with a dynamic control, which is added either programmatically or by a user selecting the control from a catalog of controls at run time.
Gets a value that indicates whether a control is a static control, which means the control is declared in the markup of a Web Parts page and not added to the page programmatically.
2.0.0.0
Method
2.0.0.0
System.Void
The method in the base class contains no implementation. Derived controls can override the method if needed to provide custom handling when the control is closed. The control automatically invokes the method if you provide an implementation in a derived class.
Enables derived classes to provide custom handling when a control is closed on a Web Parts page.
An that contains the event data.
Method
2.0.0.0
System.Void
The method in the base class contains no implementation.
Enables derived classes to provide custom handling when a control is beginning or ending the process of connecting to other controls.
An that contains the event data.
Method
2.0.0.0
System.Void
The method in the base class contains no implementation.
Enables derived classes to provide custom handling when a control is permanently removed from a Web Parts page.
An that contains the event data.
Method
2.0.0.0
System.Void
The method in the base class contains no implementation.
Enables derived classes to provide custom handling when a control is entering or leaving edit mode.
An that contains the event data.
Method
System.Void
The method sets a flag indicating that control state data has been changed (personalized) on a control, and that the control therefore needs to persist the personalization data to long term storage.
Normally the persists personalization changes on controls without a need for developers to call the method. But there are two cases in which developers do need to call this method. The first case is when control state data is changed during an HTTP GET request to a page. By default, changes to control state data during a GET request are not persisted (for security purposes). But the method provides a way to persist legitimate personalization changes to controls in this case.
The second case for calling the method occurs during an HTTP POST request to a page. If a control has complex personalizable properties (such as a property that contains an object), and control state data in those properties is personalized during a POST request, developers must call the method to ensure that the changes are persisted.
Sets a flag indicating that personalization data has changed for the current control instance.
2.0.0.0
Method
System.Void
The method has the same purpose as the method, which is to set a flag indicating that control state data has been changed (personalized) on a server control during an HTTP GET request. The difference between these methods is that the method is used for server controls that do not inherit from the class, but are placed within zones to participate in Web Parts applications.
Sets a flag indicating that personalization data has changed for the specified server control that resides in a zone.
The for which the personalization data has changed.
2.0.0.0
Property
System.String
To be added.
Use the property optionally to return a standard subtitle string in your custom control that will be appended to the control's title.
If you provide a value for the property in a custom control, the Web Parts control set automatically appends it to the value of the property to create a complete title for the control.
The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see and ASP.NET Globalization and Localization.
Gets a string that is concatenated with the property value to form a complete title for a control.
2.0.0.0
Property
System.String
To be added.
If a developer assigns a value to the property, then that value determines all (or at least part of) the text in the control's title bar. The title text also appears as part of the ToolTip text when you position your mouse pointer over the title bar of a control or other server control that appears in a zone.
The complete text displayed in a control's title bar is also affected by the property. If that property has a value assigned to it, the value is concatenated to the title. If no value is assigned to the property, a calculated title is displayed. At any point, developers can retrieve the actual, total text displayed in a control's title bar by getting the value of the property.
The style of the title text is determined by the property of the zone that contains the part control.
For a code example that demonstrates the use of the base property, see the property.
Gets or sets the title of a part control.
2.0.0.0
Property
System.String
To be added.
The personalization scope of this property is set to and can be modified only by authorized users. For more information, see and Web Parts Personalization Overview.
Gets or sets the URL to an image used to represent a Web Parts control in the control's title bar.
2.0.0.0
Property
System.String
To be added.
When you assign a URL to the property, the title of the control becomes a link to supplemental information about the control. The URL is not rendered when the page is in a display mode where controls can be dragged, such as design, edit, or catalog mode.
This property cannot be set by themes or style sheet themes. For more information, see and ASP.NET Themes Overview.
The personalization scope of this property is set to and can be modified only by authorized users. For more information, see and Web Parts Personalization Overview.
Gets or sets a URL to supplemental information about a control.
2.0.0.0
Method
System.Void
To be added.
To be added.
2.0.0.0
Property
System.Web.UI.WebControls.WebParts.WebPartVerbCollection
To be added.
Verbs derive from the class, and provide user interface (UI) actions that users can perform on a control. Usually verbs are represented in the UI as buttons, links, or menu items. By default, common Web Parts verbs appear on a drop-down verbs menu in each control's title bar. There are standard verbs for opening, closing, editing, and minimizing a control, and other verbs for exporting a definition for the control or loading a Help file. These verbs are not included in the collection, because the collection contains only custom verbs that you create and return by overriding this property in a derived class.
When you create custom verbs and add them to the collection, you can then access the verbs programmatically from a control.
Gets a collection of custom verbs associated with a control.
2.0.0.0
Property
System.Web.UI.WebControls.Unit
To be added.
To be added.
To be added.
2.0.0.0
Property
System.Int32
To be added.
The property indicates a Web Parts control's numerical order (or ordinal position) within its zone, relative to other controls in the zone. The control uses this property to track and manage its collection of Web Parts controls on a Web page.
You cannot assume that the value of the property for a control will equal the index value for the same control within the collection of the control's zone. Often a control's relative position in its zone (its value), and its index within the collection of its zone, will be different values as controls are added to and removed from zones.
Gets the index position of a control within its zone.
2.0.0.0