Export (0) Print
Expand All

WebPartZoneBase.GetInitialWebParts Method

Gets an initial collection of WebPart controls contained in a zone, based on a template or some storage medium.

Namespace:  System.Web.UI.WebControls.WebParts
Assembly:  System.Web (in System.Web.dll)

protected internal abstract WebPartCollection GetInitialWebParts()

Return Value

Type: System.Web.UI.WebControls.WebParts.WebPartCollection
A WebPartCollection that contains the initial set of WebPart controls that belong in a zone.

The GetInitialWebParts method gets the initial collection of WebPart controls for a zone only if there is a preexisting template or other form of storage that determines what controls are in the zone. The method does not reflect any personalization changes, which might mean that controls in the initial collection have actually been moved by a user into another zone.

The initial collection of WebPart controls in the zone are not necessarily the same as the collection contained in the WebParts property of the zone, which reflects the actual current collection of controls in the zone when a page is rendered, taking into account any personalization changes that have been made.

Notes to Implementers

The GetInitialWebParts method is abstract, so it must be implemented by derived classes. The GetInitialWebParts method of the WebPartZone class contains one implementation of the method.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0
Show:
© 2015 Microsoft