WebPartPagesWebService.SaveWebPart2 Method

Saves changes to an existing dynamic Web Part, including a change to the Web Part type.

Web Service: Web Part PagesWeb Reference: http://<Site>/_vti_bin/WebPartPages.asmx


<SoapDocumentMethodAttribute("http://microsoft.com/sharepoint/webpartpages/SaveWebPart2", RequestNamespace:="http://microsoft.com/sharepoint/webpartpages", ResponseNamespace:="http://microsoft.com/sharepoint/webpartpages", Use:=SoapBindingUse.Literal, ParameterStyle:=SoapParameterStyle.Wrapped)> _
Public Sub SaveWebPart2 ( _
    pageUrl As String, _
    storageKey As Guid, _
    webPartXml As String, _
    storage As Storage, _
    allowTypeChange As Boolean _

Dim instance As WebPartPagesWebService
Dim pageUrl As String
Dim storageKey As Guid
Dim webPartXml As String
Dim storage As Storage
Dim allowTypeChange As Boolean

instance.SaveWebPart2(pageUrl, storageKey, webPartXml, storage, allowTypeChange)
[SoapDocumentMethodAttribute("http://microsoft.com/sharepoint/webpartpages/SaveWebPart2", RequestNamespace="http://microsoft.com/sharepoint/webpartpages", ResponseNamespace="http://microsoft.com/sharepoint/webpartpages", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Wrapped)] 
public void SaveWebPart2 (
    string pageUrl,
    Guid storageKey,
    string webPartXml,
    Storage storage,
    bool allowTypeChange


  • pageUrl
    The URL of the source page.
  • storageKey
    A GUID that identifies the Web Part.
  • webPartXml
    A string containing the XML information on the Web Part.
  • storage
    A Storage value indicating how the Web Part is stored
  • allowTypeChange
    true to allow saving the Web Part as a different type; otherwise, false.


If allowTypeChange is set to false, the behavior of the SaveWebPart2 method is the same as that of the SaveWebPart method.

If allowTypeChange is set to true, you can edit the value of <TypeName>.

To access the WebPartPagesWebService service and its methods, set a Web reference to http://Virtual_Server_Name:Port_Number/_vti_adm/WebPartPages.asmx.

See Also


WebPartPagesWebService Class
WebPartPagesWebService Members
Web Part Pages Web Service