Click or drag to resize
PortalHelperAddNewWebPart Method
Adds the new web part to the page and returns its instance.

Namespace: CMS.PortalEngine.Web.UI
Assembly: CMS.PortalEngine.Web.UI (in CMS.PortalEngine.Web.UI.dll) Version: 12.0.0
Syntax
C#
public static WebPartInstance AddNewWebPart(
	int webpartId,
	string zoneId,
	bool isLayoutZone,
	int zoneVariantId,
	int position,
	PageTemplateInstance templateInstance,
	DataRow row = null
)

Parameters

webpartId
Type: SystemInt32
The web part id
zoneId
Type: SystemString
The zone id
isLayoutZone
Type: SystemBoolean
Indicates whether the zone is a layout zone
zoneVariantId
Type: SystemInt32
The zone variant id
position
Type: SystemInt32
The position of the web part in the zone
templateInstance
Type: CMS.PortalEnginePageTemplateInstance
The template instance
row (Optional)
Type: System.DataDataRow
The data of the new web part

Return Value

Type: WebPartInstance
See Also