Contains a read-only collection of WebPartZone controls.
Assembly: System.Web (in System.Web.dll)
Returns a specific member of the collection by passing in an integer.
Returns a specific member of the collection by passing in a unique identifier.
Returns a value indicating whether a particular zone exists in the collection.
Copies the collection to an array of WebPartZoneBase objects.
Determines whether the specified object is equal to the current object.(Inherited from Object.)
Serves as the default hash function. (Inherited from Object.)
Returns the position of a particular member of the collection.
Returns a string that represents the current object.(Inherited from Object.)
Overloaded. Enables parallelization of a query.(Defined by ParallelEnumerable.)
The WebPartZone controls that exist on a Web Parts page. It is used primarily by the WebPartManager control to track and manage all the zones. The WebPartManager control keeps a reference to the collection of zones on a page in its read-only Zones property.class contains the collection of
Theclass is useful when you want to carry out operations on multiple zones or their contents at the same time, or when you need to locate a particular zone and examine or change its contents. Although the collection of zones itself is read-only and you cannot change the size of the collection object itself, you can still get references to the individual zones within the collection, and when you have a reference to an individual zone object, you can change its property values.
The WebPartZoneCollection(), simply initializes an empty instance of a new . The second one, WebPartZoneCollection(ICollection), initializes a collection by passing in an existing collection of zones.class has two constructors. The first one,
The Item property. This property allows you to locate a WebPartZone control within the collection by passing in a string identifier. The zone is located by matching the string identifier to the value of the ID property on a WebPartZoneBase zone.class contains an
The Contains method determines whether a particular zone exists in the collection. The CopyTo method copies the collection to an array of WebPartZoneBase objects. Finally, the IndexOf method returns the index of a particular zone within the collection.class also has several methods that are useful for examining or accessing its contents. The
The following code example demonstrates the use of theclass. The code example contains three parts: two sections of code, and an explanation of how to run the example.
The first part of the code example is a Web page that contains three WebPartZone controls, each of which contains a single server control. Although these server controls are all standard ASP.NET controls, they can act as WebPart controls at run time because they are placed within a WebPartZone zone.
The second part of the code example is the partial class that contains the code to demonstrate usage of theclass. This code handles the events for the Web page.
Load the page in a browser. The three WebPartZone zones are visible with their contained server controls. Near the bottom of the page are several buttons, each of which demonstrates some aspect of working with the object. Click each button to see its effect on the zones and their contents. To view the code associated with each button that demonstrates some aspect of the object, view the code in the partial class file referenced above as the second part of this code example.
Available since 2.0
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.