Partager via


HitCounter Method

Generates a hit on a page containing a hit counter.

Syntax

<Method ID="0,HitCounter">
  <SetVar Name="Cmd">HitCounter</SetVar>
  <SetVar Name="Page">URL</SetVar>
  <SetVar Name="Image">[0-4]</SetVar>
  <SetVar Name="Custom">URL</SetVar>
  <SetVar Name="Digits">Integer</SetVar>
</Method>

Parameters

ID = "Text"

Name = "Cmd"

Name = "Page"

Name = "Image"

Name = "Custom"

Name = "Digits"

Decoded

<Method ID="0,HitCounter">
  <SetVar Name="Cmd">HitCounter</SetVar>
  <SetVar Name="Page">Lists/Announcements/AllItems.aspx</SetVar>
  <SetVar Name="Image">3</SetVar>
</Method>

Remarks

Because the HitCounter method writes out the actual binary data of the image, this method should be used in URL protocol and not in posts using the Batch and Method elements.

Return Value

Success

Returns the code attribute, which is a signed-decimal representation of an HRESULT, such as <Result ID="0,HitCounter" Code="0" />. If either the Image parameter or Custom parameter is specified, returns the new total using the specified image.

Error

Returns an XML-encoded Unicode (UTF-8) text string. For more information, see Error Message Format for Windows SharePoint Services.