Compartilhar via


ViewAttributes Property

The ViewAttributes property of the SPQuery class gets or sets the attributes of the view used in the query.

Property Value

A string that contains the view attributes.

Remarks

The ViewAttributes property contains attributes of the View element used in Collaborative Application Markup Language (CAML). For example, if the Scope attribute is set to Recursive (Scope="Recursive"), the query displays all the files within a document library, including ones in subfolders. If it is set to anything else, the query displays only files in the top folder.

Example

The following code example sets a recursive scope for a query and displays all files contained within a specified document library.

This example requires using directives (Imports in Visual Basic) for the Microsoft.SharePoint, Microsoft.SharePoint.Utilities, and Microsoft.SharePoint.WebControls namespaces.

Requirements

Platforms: Microsoft Windows Server 2003

Security: Code Access Security