Skip to main content
Tab

ASPxHyperLink Class

Represents a text editor with hyperlink functionality.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.1.dll

NuGet Package: DevExpress.Web

Declaration

Remarks

The ASPxHyperLink editor diplays its contents as a hyperlink.

Design Time

The ASPxHyperLink control is available on the DX.24.1: Common Controls toolbox tab in the Microsoft Visual Studio IDE.

Drag the control onto a form and customize the control’s settings, or paste the control’s markup in the page’s source code.

<dx:ASPxHyperLink ID="link" runat="server" Text="Demos" NavigateUrl="https://demos.devexpress.com/asp/" />

Run Time

using DevExpress.Web;
...
protected void Page_Load(object sender, EventArgs e)
{
    ASPxHyperLink link = new ASPxHyperLink();
    link.ID = "link";
    Page.Form.Controls.Add(link);

    link.NavigateUrl = "https://demos.devexpress.com/asp/";
    link.Text = "Demos";
}

Note

DevExpress controls require that you register special modules, handlers, and options in the Web.config file. You can change this file or switch to the Design tab in the Microsoft Visual Studio IDE to automatically update the Web.config file. Note that this information is automatically registered if you use the DevExpress Template Gallery to create a project.

To activate the editor’s hyperlink functionality the ASPxHyperLink.NavigateUrl property should be defined which specifies the command to execute when the editor’s hyperlink is clicked. The action performed by the ASPxHyperLink editor is determined by the protocol prefix included in the specified URL of the hyperlink. For instance:

  • “https://www.devexpress.com/“ - opens the DeveloperExpress, Inc. website. Note, that specifying a website URL without the protocol prefix results in an attempt to open the specified website from the project’s folder.
  • “file:///c:\images\blue.bmp” - opens the image located at the specified path.

The ASPxHyperLink.Target property specifies the frame where the hyperlinked document will be displayed.

The content of the editor’s hyperlink can be represented by either a caption text or an image. The editor’s caption text can be specified by the ASPxHyperLink.Text property. To define an image use the ASPxHyperLink.ImageUrl property which if set has priority over the caption text.

Note

The client-side equivalent of this editor control is represented by the ASPxClientHyperLink object. The editor’s client-side API is enabled if the ASPxEditBase.EnableClientSideAPI property is set to true, or any client event is handled. Available client events can be accessed via the ASPxStaticEdit.ClientSideEvents property.

See Also