Display Method

Applies to: SharePoint Foundation 2010

Runs a database query and returns list data in XML or HTML format. You can specify the nature of the query, content to be returned, and the return format.

<Method ID="Text">
  <SetList Scope="Request">GUID</SetList>
  <SetVar Name="Cmd">Display</SetVar>
  <SetVar Name="XMLDATA">[TRUE|FALSE]</SetVar>
  <SetVar Name="View">GUID</SetVar>
  <SetVar Name="Query">Text</SetVar>
  <SetVar Name="Using">Text</SetVar>
  <SetVar Name="CacheControl">Text</SetVar>
  <SetVar Name="ID">Text</SetVar>




ID = "Text"

Application-specific string. In an HTML editor compatible with Microsoft SharePoint Foundation, such as Microsoft Office SharePoint Designer 2007, the string provides the sequence number and name of the method.

Scope = "Request"

When set to Request, the Scope attribute sets the variable for the scope of the enclosing Method element, unless the variable is changed by another tag.

Name = "Cmd"

Must be set to Display.

Name = "XMLDATA"

If <SetVar Name="XMLDATA">TRUE</SetVar> is specified in the post, the schema and data of the list are displayed depending on usage of the Query and View parameters. If not specified, the Using parameter is used.

Name = "View"

Specifies the GUID of the list view to use. If null, the default view is used.

Name = "Query"

Contains a sequence of list fields separated by a space. This parameter can also contain an asterisk (*), which returns the schema and data for all fields in the list. If the Query parameter is not passed, the View parameter is used.

Name = "Using"

Specifies the relative URL of the file used for exporting an item or list. Possible file names include vcard.vcf, event.ics, query.iqy, and query.bqy. When the Using parameter is passed, the CacheControl parameter should also be used. The Using parameter is used in the following tasks:

  • To specify the relative URL of the event.ics file (for example, Lists/Events/event.ics) when exporting an event to Microsoft Office Outlook 2007. The ID parameter is used to identify the event in the events list to export.

  • To specify the relative URL of the vcard.vcf file (for example, Lists/Contacts/vcard.vcf) when exporting a contact to Outlook. The ID parameter is used to identify the contact in the contacts list to export.

  • To specify the relative URL of the query.iqy or query.bqy file (for example, Lists/Announcements/query.iqy) when exporting a list to Microsoft Office Excel 2007.

Name = "CacheControl"

Sets a cache control that prevents the response from being cached on the client.

Name = "ID"

Specifies the ID of a list item to export. This parameter is used in conjunction with the Using parameter.


<Method ID="0,Display">
  <SetList Scope="Request">GUID</SetList>
  <SetVar Name="Cmd">Display</SetVar>
  <SetVar Name="XMLDATA">TRUE</SetVar>


When used in URL protocol to make an HTTP GET request, this method requires a List parameter that specifies the GUID of the list.