Partager via


AddWebPart Method

The AddWebPart method of the Web Part Pages service adds a new Web Part to a Web Part Page.

Parameters

Return Value

System.Guid The identifier of the newly created Web Part.

Example

The following code example shows a locally defined AddWebPart method that adds a Web Part and then modifies it by calling the AddWebPart and SaveWebPart methods of the Web Part Pages service through a proxy. This code example and the proxy are part of a larger example provided for the Web Part Pages service.

Requirements

Platforms: Microsoft Windows Server 2003

Web Reference: http://Server_Name[sites/][Site_Name/]/_vti_bin/WebPartPages.asmx

Security: Code Access Security