WebPartChrome Constructor

Note: This constructor is new in the .NET Framework version 2.0.

Initializes a new instance of the control.

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

public:
WebPartChrome (
	WebPartZoneBase^ zone, 
	WebPartManager^ manager
)
public WebPartChrome (
	WebPartZoneBase zone, 
	WebPartManager manager
)
public function WebPartChrome (
	zone : WebPartZoneBase, 
	manager : WebPartManager
)

Parameters

zone

The associated WebPartZoneBase control.

manager

The WebPartManager control on the current page.

The WebPartChrome initializes a new instance of the WebPartChrome class. It is used primarily by a WebPartZoneBase zone in its CreateWebPartChrome method to create an instance of the WebPartChrome object that handles the chrome rendering and any custom rendering for WebPart controls in the zone.

The following code example demonstrates two things. First, it creates a new instance of the custom class MyWebPartChrome by overriding the CreateWebPartChrome method in a derived WebPartZoneBase zone called MyZone. Second, in the constructor of the MyWebPartChrome class, it assigns the objects in the parameters of the constructor to private fields that can be used within the class. This example thus gives you a way to access the associated zone and WebPartManager object even in the constructor, before the Zone and WebPartManager properties are accessible. Finally, note that for the constructor to work, the base constructor must also be invoked as part of the method declaration.

The following code contains the two custom classes. For the full code required to run the example, including the Web page to host these controls, see the Example section of the WebPartChrome class overview topic.

No code example is currently available or this language may not be supported.

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show: