HyperlinkButton
Version:
You can use a HyperlinkButton control in two different ways:
- You can specify the URL of a resource that users go to when they click the button. You use the NavigateUrl property for this.
- You can specify a JavaScript that SPEAK executes when users click the button. You use the Click property for this.
The NavigateUrl property takes precedence over Click. If the NavigateUrl property has a value, the HyperlinkButton control executes the JavaScript specified in the Click property.
A HyperlinkButton control looks like a hyperlink on a webpage. You can set the text that it displays.
HyperlinkButton controls can be part of a HyperlinkButtonsGroup container.
Properties
Properties
| Name | Description | Default |
|---|---|---|
| Appearance | ||
| Text | Text displayed by the HyperlinkButton control. You can enter a static text, set the text from page code, or you can bind to a property of another control. | |
| Behavior | ||
| NavigateUrl | Specifies a resource that the page should navigate to when the button is clicked. You can specify a Sitecore path to an item, for example: /sitecore/client/sitecore/applications/sample/pages/about to navigate to another page in your application.You can also specify a URL to a web resource, for example: http://www.sitecore.net. | |
| Target | Specifies a text string that the button renders as an HTML “target” attribute. SPEAK does not validate the string: it renders it as is. This property is ignored when NavigateUrl is not set, and it does not have any effect for JavaScript in the Click property. | |
| Events | ||
| Click | Specifies the JavaScript that is executed when a user clicks the button. |
Configuration
You can create a configuration item for a HyperlinkButton control by creating an item based on the HyperlinkButton Parameters template.
The configuration item has these specific fields:
- IsButtonMode
- NavigateUrl
- Target
- Text – this field corresponds to the Text property, and you use the field to make it easier to translate UI texts.
It inherits these fields:
- Click
- IsEnabled
- IsVisible
- AccessKey
- Tooltip
- Behaviors
- Id
If you have suggestions for improving this article, let us know!