FilterLink Element (View)

Applies to: SharePoint Foundation 2010

Returns the URL for filtering a view; typically used in the toolbars that appear above lists.

<FilterLink
  AutoHyperLink = "TRUE" | "FALSE"
  AutoHyperLinkNoEncoding = "TRUE" | "FALSE"
  AutoNewLine = "TRUE" | "FALSE"
  Default = "Text"
..ExpandXML = "TRUE" | "FALSE"
  HTMLEncode = "TRUE" | "FALSE"
  Paged = "TRUE" | "FALSE"
  StripWS = "TRUE" | "FALSE"
  URLEncode = "TRUE" | "FALSE"
  URLEncodeAsURL = "TRUE" | "FALSE">
</FilterLink>

Attributes

Attribute

Description

AutoHyperLink

Optional Boolean. TRUE to surround text with <A> tags if the text appears like a hyperlink (for example, www.microsoft.com).

AutoHyperLinkNoEncoding

Optional Boolean. TRUE to surround text with <A> tags if the text appears like a hyperlink (for example, www.microsoft.com) but without HTML encoding.

AutoNewLine

Optional Boolean. TRUE to insert <BR> tags into the text stream and to replace multiple spaces with a nonbreaking space (&nbsp;).

Default

Optional Text. Specifies the filter string to use in generating the hypertext reference (HREF) for a link to an item when the URL does not specify a Filter parameter. If empty, the link URL will not contain a Filter parameter.

ExpandXML

Optional Boolean. TRUE to re-pass the rendered content through the Collaborative Application Markup Language (CAML) interpreter, which allows CAML to render CAML.

HTMLEncode

Optional Boolean. TRUE to convert embedded characters so that they are displayed as text in the browser. In other words, characters that could be confused with HTML tags are converted to entities.

Paged

Optional Boolean. TRUE if items in the list are displayed page by page.

StripWS

Optional Boolean. TRUE to remove white space from the beginning and end of the value returned by the element.

URLEncode

Optional Boolean. TRUE to convert special characters, such as spaces, to quoted UTF-8 format (for example, %c3%ab for character ë).

URLEncodeAsURL

Optional Boolean. Like URLEncode, but TRUE to specify that the string to encode is a path component of a URL so that forward slashes ("/") are not encoded.

Child Elements

None

Parent Elements

Numerous

Occurrences

Minimum: 0

Maximum: Unbounded

Remarks

The FilterLink element returns a URL string like the following:

http://Site_Name/Lists/Events/AllItems.aspx?Filter=1&View=%7b4A760E71%2dEBF2%2d4A88%2d9B2E%2dCFDE10E1825A%7d

Example

The following example uses the FilterLink element to construct a hyperlink for the filter icon, so that clicking the icon posts the URL for applying filter options in the list view.

<HTML><![CDATA[ <a tabindex=2 ID=diidFilterButton class="ms-toolbar" 
   title=]]></HTML>
<HTML>"Filter"</HTML>
<HTML><![CDATA[ ACCESSKEY=L href="javascript:" 
   OnClick='javascript:SubmitFormPost("]]></HTML>
<ScriptQuote NotAddingQuote="TRUE">
   <FilterLink Paged="FALSE"/>
</ScriptQuote>
<HTML><![CDATA[");javascript:return false;'>
   <img src="/_layouts/images/tbfilter.gif" ID="tbbuttonstart1" 
   alt=]]></HTML>
<HTML>"Filter"</HTML>
<HTML><![CDATA[ border=0 width=16 height=16></a></HTML>