WebPart Controls
The Web Parts control set is extensive, but some controls are essential either because they are required for Web Parts to work, or because they are the controls most frequently used on Web Parts pages. As you begin using WebParts and creating basic Web Parts pages, it is helpful to be familiar with the following essential WebParts controls:
- WebPartManager
Manages all Web Parts controls on a page. One (and only one) WebPartManager control is required for every Web Parts page.
- CatalogZone
Contains CatalogPart controls. Use this zone to create a catalog of Web Parts controls from which users can select controls to add to a page.
- EditorZone
Contains EditorPart controls. Use this zone to enable users to edit and personalize Web Parts controls on a page.
- WebPartZone
Contains and provides overall layout for the Web Part controls that compose the main user interface (UI) of a page. Use this zone whenever you create pages with Web Parts controls. Pages can contain one or more zones.
- ConnectionsZone
Contains Connection controls.
- GenericWebPart
Renders the primary UI; most Web Parts UI controls fall into this category. For maximum programmatic control, you can create custom Web Parts controls that derive from the base WebPart control. You can also use existing server controls, user controls, or custom controls as Web Parts controls. Whenever any of these controls are placed in a zone, the WebPartManager control automatically wraps them with GenericWebPart controls at run time so that you can use them with WebParts functionality.
- CatalogPart
Contains a list of available Web Parts controls that users can add to the page
- Connection
Creates a connection between two Web Parts controls on a page. The connection defines one of the Web Parts controls as a provider (of data) and the other as a consumer.
- EditorPart
Serves as the base class for the specialized editor controls.
Web Part Page Modes
A Microsoft ASP.NET Web Parts page can enter several different display modes. A display mode is a special state that applies to an entire page, where certain user interface (UI) elements are visible and enabled, while others are invisible and disabled. Display modes enable users to perform certain tasks to modify or personalize a page, such as editing Web Parts controls, changing the layout of a page, or adding new controls from a catalog of available controls.
How Web Parts Display Modes Work?
A page can be in only one display mode at a time. The WebPartManager control contains the implementation for the display modes that are available in the Web Parts control set and manages all display mode operations for a page. Typically, you provide a UI that enables users to switch among display modes as needed. You can change a page’s display mode programmatically, using the DisplayMode property. There are five standard display modes in the Web Parts control set: browse (the normal mode in which a user views a Web page), design, edit, catalog, and connect. Each of these display modes is derived from the WebPartDisplayMode class. The following list describes the display modes and summarizes their behavior:
- Browse
Displays Web Parts controls and UI elements in the normal mode in which users view a page.
- Design
Displays zone UI and enables users to move Web Parts controls to change the layout of a page.
- Edit
Displays special editing UI elements and enables users to edit the controls on a page. Allows dragging of controls, just as design mode does.
- Catalog
Displays special catalog UI elements and enables users to add and remove page controls. Allows dragging of controls, just as design mode does.
- Connect
Displays special connections UI elements and enables users to connect Web Parts controls.

No comments:
Post a Comment