GetViewCollection Method

The GetViewCollection method of the Views service returns the display names, internal names, and URLs for the collection of views of the specified list.

Parameters

listName   A string that contains the internal name of the list.

Return Value

A fragment in Collaborative Application Markup Language (CAML) in the following form that contains the view properties and that can be assigned to a System.Xml.XmlNode object:

<GetViewCollectionResult>
   <Views>
      <View DisplayName="Allitems" Name="{C1036607-EC8A-11d3-82AA-0050048394B0}"
         Url="List\Events\Allitems.aspx" />
      <View DisplayName="Summary" Name="{F1036607-EC8A-11d3-82AA-5556047394B0}"
         Url="List\Events\Summary.aspx" />
         .
         .
         .
   </Views>
</GetViewCollectionResult>

Example

The following code example uses the GetViewCollection method to display information about the views for a list.

This example requires that a using (C#) or Imports (Visual Basic .NET) directive be included for the System.Xml namespace.

Requirements

Platforms: Microsoft Windows Server 2003

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