WebPartManager.CreateDynamicWebPartID Method

Generates a unique ID for a dynamic WebPart control.

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

protected:
virtual String^ CreateDynamicWebPartID (
	Type^ webPartType
)
protected String CreateDynamicWebPartID (
	Type webPartType
)
protected function CreateDynamicWebPartID (
	webPartType : Type
) : String
Not applicable.

Parameters

webPartType

The Type of the control for which an ID is being generated.

Return Value

A string that contains the unique ID for a control.

Exception typeCondition

ArgumentNullException

webPartType is a null reference (Nothing in Visual Basic).

When WebPart controls are added to a Web page, they can be static (which means the control is declared in the page markup) or dynamic (which means they are added programmatically). In any scenario where the WebPartManager control is creating new dynamic controls to add to the page, it calls this method to generate a unique ID.

The method is virtual so that developers can override it if they want to provide a custom implementation for generating the ID.

Windows 98, Windows Server 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 Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show: