Skip to content

<xmod:ToggleImage>

<xmod:ToggleImage> renders a clickable image that toggles the visibility of the element matched by Target — same behavior as <xmod:ToggleButton>, just rendered as an image rather than a push-button.

Requires jQuery

The hosting page must include jQuery.

Sibling variants

Example

html
<xmod:Template Id="Employees">
  <ListDataSource CommandText="SELECT EmployeeId, FirstName, LastName, Evaluation FROM Employees" />
  <ItemTemplate>
    <strong>[[FirstName]] [[LastName]]</strong>
    <xmod:ToggleImage AlternateText="View Evaluation" ImageUrl="~/images/expand.gif"
        Target='[[Join("#divEvaluation_{0}",[[EmployeeId]])]]' Speed="Fast" />
    <div id="divEvaluation_[[EmployeeId]]" style="display:none;">
      <p>[[Evaluation]]</p>
    </div>
  </ItemTemplate>
</xmod:Template>

Properties

PropertyValuesDefaultDescription
Target *jQuery selectorThe element to show/hide
ImageUrlURLPath to the image file. Tilde (~) supported
AlternateTextstringAlt text for screen readers and search engines
SpeedSlow Normal Fast | integer (ms)(instant)Transition speed. Omit for an instant toggle
CssClassstringCSS class name(s)
StylestringInline CSS
ToolTipstringHover tooltip
VisibleTrue FalseTrueShows or hides the control

* Required property

Deprecated Properties (styling)

BackColor, BorderColor, BorderStyle, BorderWidth, Font-*, ForeColor — use CssClass or Style instead.

See <xmod:ToggleButton> for full property details and the inline-element caveat with Speed.