Back to Devexpress

ASPxHyperLink Class

aspnet-devexpress-dot-web-e9acc451.md

latest6.4 KB
Original Source

ASPxHyperLink Class

Represents a text editor with hyperlink functionality.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public class ASPxHyperLink :
    ASPxStaticEdit
vb
Public Class ASPxHyperLink
    Inherits ASPxStaticEdit

Remarks

The ASPxHyperLink editor diplays its contents as a hyperlink.

Design Time

The ASPxHyperLink control is available on the DX.25.2: 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.

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

Run Time

csharp
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";
}
vb
Imports DevExpress.Web

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
    Dim link As ASPxHyperLink = New ASPxHyperLink()
    link.ID = "link"
    Page.Form.Controls.Add(link)

    link.NavigateUrl = "https://demos.devexpress.com/asp/"
    link.Text = "Demos"
End Sub

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.

Implements

Show 15 items

IComponent

IDisposable

IParserAccessor

IDataBindingsAccessor

IControlBuilderAccessor

IControlDesignerAccessor

IExpressionsAccessor

IAttributeAccessor

IUrlResolutionService

INamingContainer

IPostBackDataHandler

IPostBackEventHandler

ICallbackEventHandler

IPropertiesOwner

IDataSourceViewSchemaAccessor

Inheritance

Show 12 items

Object Control WebControl ASPxWebControlBase ASPxWebControl ASPxDataWebControlBase ASPxDataWebControl ASPxEditBase ASPxStaticEdit ASPxHyperLink BootstrapHyperLink

MVCxHyperLink

See Also

ASPxHyperLink Members

HyperLinkProperties

Hyperlink

DevExpress.Web Namespace