Skip to content

<xmod:AddButton>

<xmod:AddButton> renders a push-button that, when clicked, switches the module to the AddForm — the form configured to add new records. Use <Parameter> child tags to pass values into the AddForm's <SelectCommand> (so default values can be derived from the current row).

This tag is gated by the parent template's AddRoles when placed inside <xmod:Template>/<xmod:DataList>. When placed outside any template, it's gated by the module's Configure → Security tab.

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>
  </ItemTemplate>
  <FooterTemplate>
    <xmod:AddButton Text="New Employee" />
  </FooterTemplate>
</xmod:Template>

Properties

PropertyValuesDefaultDescription
IDstringUnique identifier for the button
TextstringCaption displayed on the button
AjaxTrue FalseFalseWhen True, switches to the AddForm via async postback. The button must have ID set (since v2.6)
Formform nameOverride the configured AddForm 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)
PropertyValuesDescription
BackColorcolor name | #ddddddBackground color
BorderColorcolor name | #ddddddBorder color
BorderStyleNotSet None Dotted Dashed Solid Double Groove Ridge Inset OutsetBorder style
BorderWidthsizeBorder width
Font-Bold / Font-Italic / Font-Names / Font-Overline / Font-Size / Font-Strikeout / Font-UnderlinevariousFont styling — use CssClass instead
ForeColorcolor name | #ddddddText color

Child Tags

TagRequiredDescription
<Parameter>optionalPasses a value into the AddForm's <SelectCommand> parameter of the same name

<Parameter>

Use one <Parameter> for each @param in the AddForm's <SelectCommand>. The values become defaults for the form's controls when the form first loads.

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

Property Details

  • Ajax: When True, the AddForm appears in place via async postback rather than a full page refresh. The button must have its ID property set for AJAX to work — without an ID, you'll typically see a "click twice" symptom where the form only appears on the second click. The parent <xmod:Template> should also have Ajax="True".

  • Form: Specifies an alternate form name to load instead of the AddForm configured for the module. Useful when one page has multiple <xmod:Template> tags and each needs its own AddForm — set Form="EmployeeAdd" on one template and Form="ContractorAdd" on another.