Skip to content

<xmod:DeleteImage>

<xmod:DeleteImage> renders a clickable image that deletes the current row — same behavior as <xmod:DeleteButton>, just rendered as an image rather than a push-button.

Sibling variants

Example

html
<xmod:Template Id="Employees">
  <ListDataSource CommandText="SELECT * FROM Employees" />
  <DeleteCommand CommandText="DELETE FROM Employees WHERE EmployeeId = @EmpID">
    <Parameter Name="EmployeeId" Alias="EmpID" />
  </DeleteCommand>
  <ItemTemplate>
    <strong>[[FirstName]] [[LastName]]</strong>
    <xmod:DeleteImage AlternateText="Delete Employee" ImageUrl="~/images/delete.gif"
        OnClientClick="return confirm('Are you sure you want to delete this employee?');">
      <Parameter Name="EmployeeId" Alias="EmpID" Value="[[EmployeeId]]" DataType="Int32" />
    </xmod:DeleteImage>
  </ItemTemplate>
</xmod:Template>

Properties

PropertyValuesDefaultDescription
IDstringUnique identifier for the image button
ImageUrlURLPath to the image file. Tilde (~) supported
AlternateTextstringAlt text for screen readers and search engines
ImageAlignNotSet Left Right Baseline Top Middle Bottom AbsBottom AbsMiddle TextTopNotSetImage alignment relative to surrounding content
AjaxTrue FalseFalseWhen True, the delete runs via async postback. Requires ID set (since v2.6)
CssClassstringCSS class name(s)
StylestringInline CSS
WidthsizeWidth of the image
HeightsizeHeight of the image
ToolTipstringHover tooltip
VisibleTrue FalseTrueShows or hides the control
OnClientClickJavaScriptClient-side script to run on click. Returning false cancels the delete
AccessKeystringKeyboard shortcut character
EnabledTrue FalseTrueWhen False, the control is disabled
TabIndexintegerTab order for keyboard navigation
Deprecated Properties (styling)

Same set as <xmod:DeleteButton>BackColor, BorderColor, BorderStyle, BorderWidth, Font-*, ForeColor. Use CssClass or Style instead.

Child Tags

Same as <xmod:DeleteButton> — required <Parameter Name Alias Value DataType> tags supply values for the parent's <DeleteCommand>. The Alias attribute is useful when the data column has a name that conflicts with another parameter.