Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
CatalogPart Class
 GetWebPart Method
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
CatalogPart..::.GetWebPart Method

Retrieves from a catalog the WebPart control that is referenced by the WebPartDescription object passed to the method.

Namespace:  System.Web.UI.WebControls.WebParts
Assembly:  System.Web (in System.Web.dll)
Visual Basic (Declaration)
Public MustOverride Function GetWebPart ( _
    description As WebPartDescription _
) As WebPart
Visual Basic (Usage)
Dim instance As CatalogPart
Dim description As WebPartDescription
Dim returnValue As WebPart

returnValue = instance.GetWebPart(description)
C#
public abstract WebPart GetWebPart(
    WebPartDescription description
)
Visual C++
public:
virtual WebPart^ GetWebPart(
    WebPartDescription^ description
) abstract
JScript
public abstract function GetWebPart(
    description : WebPartDescription
) : WebPart

Parameters

description
Type: System.Web.UI.WebControls.WebParts..::.WebPartDescription
A WebPartDescription that contains a reference to a specific WebPart.

Return Value

Type: System.Web.UI.WebControls.WebParts..::.WebPart
A WebPart that is referenced by the object in the description parameter.

The GetWebPart method returns a WebPart control from a catalog. The WebPartDescription object that is passed to the method matches a specific WebPart control and enables that control to be returned by the method.

If a catalog contains a server control that does not derive from the WebPart class, such as an ASP.NET server control, a custom server control, or a user control, a CatalogPart control must wrap the server control with a GenericWebPart control, and return the GenericWebPart control from this method.

Notes to Inheritors:

The GetWebPart method is abstract, so it must be implemented by derived CatalogPart controls. This method is called by the zone that contains a CatalogPart control, by an associated CatalogPartChrome object, and by the WebPartManager object on a Web page.

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

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

.NET Framework

Supported in: 3.5, 3.0, 2.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker