Share via


GetView Method

The GetView method of the Views service returns the schema of the specified view for the specified list.

Parameters

Return Value

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

<View Name="{EE7C652F-9CBF-433F-B376-86B0EE989A06}"
   DefaultView="TRUE" Type="HTML" DisplayName="View_Name"
   Url="Lists/Events/File_Name.aspx" BaseViewID="1">
   <Query>
      <Where>
         <Leq>
            <FieldRef Name="Created"/>
            <Value Type="DateTime">2003-03-03T00:00:00Z</Value>
         </Leq>
      </Where>
   </Query>
   <ViewFields>
      <FieldRef Name="fRecurrence"/>
      <FieldRef Name="Attachments"/>
      <FieldRef Name="WorkspaceLink"/>
      <FieldRef Name="LinkTitle"/>
      <FieldRef Name="Location"/>
      <FieldRef Name="EventDate"/>
      <FieldRef Name="EndDate"/>
   </ViewFields>
   <RowLimit Paged="TRUE">100</RowLimit>
</View>

Remarks

The GetView method does not return the following parts of the CAML view, which contain HTML: Toolbar, ViewHeader, ViewBody, ViewFooter, ViewEmpty, PagedRowSet, and RowLimitExceeded. To return the full view definition, including these HTML sections, use the GetViewHTML method instead.

Example

The following example uses the GetView method to display a view schema for a specified 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