Back to Devexpress

ASPxHyperLink.Text Property

aspnet-devexpress-dot-web-dot-aspxhyperlink-d5bbe481.md

latest6.0 KB
Original Source

ASPxHyperLink.Text Property

Gets or sets the text caption displayed for the hyperlink in the hyperlink editor.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue("")]
public string Text { get; set; }
vb
<DefaultValue("")>
Public Property Text As String

Property Value

TypeDefaultDescription
StringString.Empty

A String value specifying the text caption for the hyperlink in the editor.

|

Remarks

This property is a wrapper of the HyperLinkProperties.Text property.

Example

This example demonstrates how to customize the ASPxHyperLink control.

aspx
<dx:ASPxHyperLink ID="ASPxHyperLink1" runat="server" Text="DevExpress" NavigateUrl="http://devexpress.com/" 
    ImageUrl="~/imgs/logo.png">
</dx:ASPxHyperLink>

The following code snippets (auto-collected from DevExpress Examples) contain references to the Text property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

xaf-how-to-show-a-hyper-link-url-email-etc-for-a-business-class-property/CS/HyperLinkPropertyEditor.Web/WebHyperLinkStringPropertyEditor.cs#L52

csharp
string url = Convert.ToString(PropertyValue);
hyperlink.Text = url;
hyperlink.NavigateUrl = GetResolvedUrl(url);

aspxgridview-dataitemtemplate-runtime/CS/HyperlinkColumn/Default.aspx.cs#L62

csharp
link.NavigateUrl = string.Format("~/details.aspx?Device={0}", gridContainer.KeyValue);
link.Text = string.Format("Get details about device {0}", gridContainer.KeyValue);
container.Controls.Add(link);

aspxgridview-hyperlink-based-on-several-cell-values/CS/Solution/Default.aspx.cs#L13

csharp
GridViewDataItemTemplateContainer container = link.NamingContainer as GridViewDataItemTemplateContainer;
link.Text = "Show New Form, Key Field = " + container.KeyValue;
link.Target = "_blank";

aspxgridview-dataitemtemplate-hyperlink-popup/CS/Solution/Default.aspx.cs#L20

csharp
link.NavigateUrl = "javascript:void(0);";
link.Text = string.Format("More Info: EAN13 - {0}", ean13);
link.ClientSideEvents.Click = string.Format("function(s, e) {{ OnMoreInfoClick('{0}'); }}", contentUrl);

xaf-how-to-show-a-hyper-link-url-email-etc-for-a-business-class-property/VB/HyperLinkPropertyEditor.Web/WebHyperLinkStringPropertyEditor.vb#L53

vb
Dim url As String = Convert.ToString(PropertyValue)
hyperlink.Text = url
hyperlink.NavigateUrl = GetResolvedUrl(url)

aspxgridview-dataitemtemplate-runtime/VB/HyperlinkColumn/Default.aspx.vb#L59

vb
link.NavigateUrl = String.Format("~/details.aspx?Device={0}", gridContainer.KeyValue)
link.Text = String.Format("Get details about device {0}", gridContainer.KeyValue)
container.Controls.Add(link)

aspxgridview-hyperlink-based-on-several-cell-values/VB/Solution/Default.aspx.vb#L16

vb
Dim container As GridViewDataItemTemplateContainer = TryCast(link.NamingContainer, GridViewDataItemTemplateContainer)
link.Text = "Show New Form, Key Field = " & container.KeyValue
link.Target = "_blank"

aspxgridview-dataitemtemplate-hyperlink-popup/VB/Solution/Default.aspx.vb#L20

vb
link.NavigateUrl = "javascript:void(0);"
link.Text = String.Format("More Info: EAN13 - {0}", ean13)
link.ClientSideEvents.Click = String.Format("function(s, e) {{ OnMoreInfoClick('{0}'); }}", contentUrl)

See Also

NavigateUrl

ImageUrl

Hyperlink

ASPxHyperLink Class

ASPxHyperLink Members

DevExpress.Web Namespace