Views.DeleteView Method
Deletes the specified view of the specified list.
Web Service: ViewsWeb Reference: http://<Site>/_vti_bin/Views.asmx
Syntax
<SoapDocumentMethodAttribute("http://schemas.microsoft.com/sharepoint/soap/DeleteView", RequestNamespace:="http://schemas.microsoft.com/sharepoint/soap/", ResponseNamespace:="http://schemas.microsoft.com/sharepoint/soap/", Use:=SoapBindingUse.Literal, ParameterStyle:=SoapParameterStyle.Wrapped)> _
Public Sub DeleteView ( _
listName As String, _
viewName As String _
)
Dim instance As Views
Dim listName As String
Dim viewName As String
instance.DeleteView(listName, viewName)
[SoapDocumentMethodAttribute("http://schemas.microsoft.com/sharepoint/soap/DeleteView", RequestNamespace="http://schemas.microsoft.com/sharepoint/soap/", ResponseNamespace="http://schemas.microsoft.com/sharepoint/soap/", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Wrapped)]
public void DeleteView (
string listName,
string viewName
)
Parameters
- listName
A string that contains the internal name of the list.
- viewName
A string that contains the GUID for the view.
Return Value
Returns a System.Web.Services.Protocols.SoapException exception if an error occurs; otherwise, returns an empty value, as shown in the following example:
<DeleteViewResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/" />
Example
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");