다음을 통해 공유


WebPartPagesWebService.SaveWebPart2 Method

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

Namespace:  [Webpartpages Web service]
Web service reference: http://Site/_vti_bin/Webpartpages.asmx

Syntax

'Declaration
<SoapDocumentMethodAttribute("https://microsoft.com/sharepoint/webpartpages/SaveWebPart2", RequestNamespace := "https://microsoft.com/sharepoint/webpartpages",  _
    ResponseNamespace := "https://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 _
)
'Usage
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("https://microsoft.com/sharepoint/webpartpages/SaveWebPart2", RequestNamespace = "https://microsoft.com/sharepoint/webpartpages", 
    ResponseNamespace = "https://microsoft.com/sharepoint/webpartpages", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public void SaveWebPart2(
    string pageUrl,
    Guid storageKey,
    string webPartXml,
    Storage storage,
    bool allowTypeChange
)

Parameters

  • storageKey
    Type: System.Guid

    A GUID that identifies the Web Part.

  • webPartXml
    Type: System.String

    A string containing the XML information on the Web Part.

  • allowTypeChange
    Type: System.Boolean

    true to allow saving the Web Part as a different type; otherwise, false.

Remarks

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

Reference

WebPartPagesWebService Class

WebPartPagesWebService Members

Webpartpages Web Service