Skip to content

<xmod:Redirect>

<xmod:Redirect> renders a clickable button (push-button, link, or image) that, on click, posts or gets data to the URL in Target. Use <Field> child tags to specify which name/value pairs to send.

It's useful for handing record-specific data off to another page or third-party service — e.g. sending a product ID to a checkout URL.

Example

html
<xmod:Template Id="Products">
  <ListDataSource CommandText="SELECT ProductId, ProductName FROM Products ORDER BY ProductName" />
  <ItemTemplate>
    [[ProductName]]
    <xmod:Redirect Text="Purchase" Target="https://shop.example.com/buy.aspx">
      <Field Name="pid" Value="[[ProductId]]" />
    </xmod:Redirect>
  </ItemTemplate>
</xmod:Template>

Properties

PropertyValuesDefaultDescription
Target *URLThe destination URL
DisplayButton LinkButton ImageButtonLinkButtonHow the control is rendered
MethodGet PostPostHTTP method used for the request
TextstringCaption for Button / LinkButton. Alt text for ImageButton
ImageUrlURLUsed only when Display="ImageButton"
ImageAlignAbsBottom AbsMiddle Baseline Bottom Left Middle Right TextTop Top NotSetNotSetImage alignment relative to surrounding content. Used only when Display="ImageButton"
OnClientClickJavaScriptJavaScript to run on click. Returning false cancels the redirect
ToolTipstringHover tooltip
VisibleTrue FalseTrueShows or hides the control
WidthsizeWidth of the control
HeightsizeHeight of the control
CssClassstringCSS class name(s)
StylestringInline CSS

* Required property

Child Tags

TagRequiredDescription
<Field>optionalOne name/value pair to include in the request. Add as many as needed

<Field>

Adds a single name/value pair to the outgoing request — query-string parameter for Method="Get", form post body for Method="Post".

AttributeValuesDefaultDescription
Name *stringField name
Valuestring | tokenField value. Field tokens are evaluated against the current row

Property Details

  • Target: The destination URL. Absolute (https://example.com/page), site-relative (~/page.aspx), or root-relative (/page.aspx).

  • Display: How the button is rendered.

    ValueRenders as
    ButtonA push button (<input type="submit">)
    LinkButton (default)An anchor styled as a button (<a>)
    ImageButtonA clickable image (<input type="image">)
  • Method: HTTP method.

    ValueBehavior
    GetFields are appended to Target as query-string parameters
    Post (default)Fields are sent as form-encoded POST body. The browser navigates to a small redirect helper that issues the POST
  • Text: For Button and LinkButton, the caption. For ImageButton, the alt text on the image.

  • ImageUrl: Path to the image file. Only used when Display="ImageButton". Tilde-prefixed paths are supported.

  • ImageAlign: How the image aligns relative to surrounding text. Only used when Display="ImageButton".