HyperLink Control

A HyperLink control looks similar to a LinkButton control. However, there is a fundamental difference: the HyperLink control only navigates to the target URL, while the LinkButton control posts the form and, if the event handler chooses, navigates to the target URL.

The HyperLink control has four specific attributes:

ImageURL

The path to an image (rather than text) to display. If this attribute is used, the control appears to the user as identical to an ImageButton control, although the ImageButton control still posts the form and the HyperLink control only navigates.

NavigateURL

The target URL to navigate to.

Text

The text string that will be displayed on the browser as the link. If both the Text and ImageURL properties are set, the ImageURL takes precedence. The text is displayed if the image is unavailable.

If the browser supports tool tips and the ToolTip property has not been set, then the Text value will display as a tool tip. If the ToolTip property has been set, then the ToolTip text string will display as a tool tip.

Target

Defines the target window or frame that will load the linked page. The value is case insensitive and must begin with a character in the range of a to z, except for the special values shown in Table 5-3, all of which begin with an underscore.

Table 5-3. Special values of the Target attribute

Value

Description

_blank

Renders the content in a new unnamed window without frames.

_new

Not documented, but behaves the same ...

Get Programming ASP .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.