Skip to content

<xmod:EditButton>

<xmod:EditButton> renders a push-button that opens the EditForm for the current row. The supplied <Parameter> tags fill the EditForm's <SelectCommand> parameters so the form loads the correct record.

This tag is gated by the parent template's EditRoles. Place it inside <ItemTemplate> or <AlternatingItemTemplate> so each row gets its own button with row-specific parameters.

Sibling variants

Example

html
<xmod:Template Id="Employees">
  <ListDataSource CommandText="SELECT * FROM Employees WHERE DepartmentId = @DepartmentId">
    <Parameter Name="DepartmentId" Alias="DepartmentId" />
  </ListDataSource>
  <ItemTemplate>
    <strong>[[FirstName]] [[LastName]]</strong>
    <xmod:EditButton Text="Edit Employee">
      <Parameter Name="EmployeeId" Value="[[EmployeeId]]" DataType="Int32" />
    </xmod:EditButton>
  </ItemTemplate>
</xmod:Template>

<EditForm>
  <SelectCommand CommandText="SELECT * FROM Employees WHERE EmployeeId = @EmployeeId" />
  ...
</EditForm>

Properties

PropertyValuesDefaultDescription
IDstringUnique identifier for the button
TextstringCaption displayed on the button
AjaxTrue FalseFalseWhen True, opens the EditForm via async postback. Requires ID set (since v2.6)
Formform nameOverride the configured EditForm with a different form (since v4.7)
CssClassstringCSS class name(s)
StylestringInline CSS
WidthsizeWidth of the button
HeightsizeHeight of the button
ToolTipstringHover tooltip
VisibleTrue FalseTrueShows or hides the button
OnClientClickJavaScriptClient-side script to run on click. Returning false cancels the action
AccessKeystringKeyboard shortcut character
EnabledTrue FalseTrueWhen False, the button is disabled
TabIndexintegerTab order for keyboard navigation
Deprecated Properties (styling)
PropertyDescription
BackColor / BorderColor / BorderStyle / BorderWidthUse CssClass or Style instead
Font-Bold / Font-Italic / Font-Names / Font-Overline / Font-Size / Font-Strikeout / Font-UnderlineUse CssClass instead
ForeColorUse CssClass or Style instead

Child Tags

TagRequiredDescription
<Parameter>required (one per <SelectCommand> parameter)Supplies the value for the EditForm's <SelectCommand> parameter of the same name

<Parameter>

Use one <Parameter> for each @param in the EditForm's <SelectCommand>. The values are typically field tokens that identify the row.

AttributeValuesDefaultDescription
Name *stringParameter name (matches @param in the EditForm's SelectCommand)
Valuestring | tokenParameter value. Field tokens like [[ID]] are typical
DataTypedatabase typeStringData type used when binding

Property Details

  • Ajax: When True, the EditForm appears in place via async postback rather than a full page refresh. The button must have its ID property set for AJAX to work. The parent <xmod:Template> should also have Ajax="True".

  • Form: Specifies an alternate form name to load instead of the EditForm configured for the module. Useful when one page has multiple <xmod:Template> tags and each needs its own EditForm.