PortalHelperAddNewWebPart Method |
Adds the new web part to the page and returns its instance.
Namespace: CMS.PortalControlsAssembly: CMS.PortalControls (in CMS.PortalControls.dll) Version: 8.2.23
Syntax 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:
WebPartInstanceSee Also