Redigera

Dela via


WebPartDescription Constructors

Definition

Initializes a new instance of the class that contains information about a specific WebPart control.

Overloads

WebPartDescription(WebPart)

Initializes a new instance of the class when a WebPart control instance is available.

WebPartDescription(String, String, String, String)

Initializes a new instance of the class by using several strings that contain description information for a WebPart control.

Remarks

The overloads for the WebPartDescription constructor each return a new instance of the WebPartDescription class, which contains information about a specific WebPart control. The difference between the overloads is the scenario in which the new instance is created. In some cases, when the application has an available instance of a WebPart control, the WebPartDescription constructor is used. When the application does not have a control instance, as is the case when a control description file is being imported through the ImportCatalogPart control, the WebPartDescription constructor is used.

WebPartDescription(WebPart)

Initializes a new instance of the class when a WebPart control instance is available.

public:
 WebPartDescription(System::Web::UI::WebControls::WebParts::WebPart ^ part);
public WebPartDescription (System.Web.UI.WebControls.WebParts.WebPart part);
new System.Web.UI.WebControls.WebParts.WebPartDescription : System.Web.UI.WebControls.WebParts.WebPart -> System.Web.UI.WebControls.WebParts.WebPartDescription
Public Sub New (part As WebPart)

Parameters

part
WebPart

A WebPart control whose information is contained in a WebPartDescription.

Exceptions

The ID property of part is null or an empty string ("").

Remarks

The WebPartDescription constructor is used for creating a new WebPartDescription object based on an existing WebPart control. This constructor simply calls the other overload, the WebPartDescription(String, String, String, String) constructor, obtaining the required parameter values from properties on the part parameter.

Applies to

WebPartDescription(String, String, String, String)

Initializes a new instance of the class by using several strings that contain description information for a WebPart control.

public:
 WebPartDescription(System::String ^ id, System::String ^ title, System::String ^ description, System::String ^ imageUrl);
public WebPartDescription (string id, string title, string description, string imageUrl);
new System.Web.UI.WebControls.WebParts.WebPartDescription : string * string * string * string -> System.Web.UI.WebControls.WebParts.WebPartDescription
Public Sub New (id As String, title As String, description As String, imageUrl As String)

Parameters

id
String

The value to assign to the ID.

title
String

The value to assign to the Title.

description
String

The value to assign to the Description.

imageUrl
String

The value to assign to the CatalogIconImageUrl.

Exceptions

id or title is null or an empty string ("").

Remarks

The WebPartDescription constructor is used to create a new instance of the WebPartDescription class when a WebPart control is not available. For example, this occurs in the case of an ImportCatalogPart control when it imports a description file for a WebPart control. It gets the information it needs to create a WebPartDescription object directly from the description file, and a WebPart instance is not present.

Applies to