<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
<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
| Property | Values | Default | Description |
|---|---|---|---|
| Target * | URL | The destination URL | |
| Display | Button LinkButton ImageButton | LinkButton | How the control is rendered |
| Method | Get Post | Post | HTTP method used for the request |
| Text | string | Caption for Button / LinkButton. Alt text for ImageButton | |
| ImageUrl | URL | Used only when Display="ImageButton" | |
| ImageAlign | AbsBottom AbsMiddle Baseline Bottom Left Middle Right TextTop Top NotSet | NotSet | Image alignment relative to surrounding content. Used only when Display="ImageButton" |
| OnClientClick | JavaScript | JavaScript to run on click. Returning false cancels the redirect | |
| ToolTip | string | Hover tooltip | |
| Visible | True False | True | Shows or hides the control |
| Width | size | Width of the control | |
| Height | size | Height of the control | |
| CssClass | string | CSS class name(s) | |
| Style | string | Inline CSS |
* Required property
Child Tags
| Tag | Required | Description |
|---|---|---|
<Field> | optional | One 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".
| Attribute | Values | Default | Description |
|---|---|---|---|
| Name * | string | Field name | |
| Value | string | token | Field 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.
Value Renders 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.
Value Behavior GetFields are appended to Targetas query-string parametersPost(default)Fields are sent as form-encoded POST body. The browser navigates to a small redirect helper that issues the POST Text: For
ButtonandLinkButton, the caption. ForImageButton, 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".