共用方式為


Views.DeleteView Method

Deletes the specified view of the specified list.

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

Syntax

'Declaration
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/DeleteView", RequestNamespace := "https://schemas.microsoft.com/sharepoint/soap/",  _
    ResponseNamespace := "https://schemas.microsoft.com/sharepoint/soap/",  _
    Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Sub DeleteView ( _
    listName As String, _
    viewName As String _
)
'Usage
Dim instance As Views
Dim listName As String
Dim viewName As String

instance.DeleteView(listName, viewName)
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/DeleteView", RequestNamespace = "https://schemas.microsoft.com/sharepoint/soap/", 
    ResponseNamespace = "https://schemas.microsoft.com/sharepoint/soap/", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public void DeleteView(
    string listName,
    string viewName
)

Parameters

  • listName
    Type: System.String

    A string that contains the internal name of the list.

  • viewName
    Type: System.String

    A string that contains the GUID for the view.

Examples

The following code example deletes a specified view.

Dim viewService As New Web_Reference_Folder.Views()
viewService.Credentials = System.Net.CredentialCache.DefaultCredentials

viewService.DeleteView("List_Name", "94276694-2ac3-4f85-8e54-2c5928476a1e")
Web_Reference_Folder.Views viewService = new Web_Reference_Folder.Views();
viewService.Credentials= System.Net.CredentialCache.DefaultCredentials;

viewService.DeleteView("List_Name","94276694-2ac3-4f85-8e54-2c5928476a1e");

See Also

Reference

Views Class

Views Members

Views Web Service