Back to Devexpress

TreeViewNode.NavigateUrl Property

aspnet-devexpress-dot-web-dot-treeviewnode-b1856682.md

latest2.4 KB
Original Source

TreeViewNode.NavigateUrl Property

Gets or sets a URL which defines the navigation location.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

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

Property Value

TypeDefaultDescription
StringString.Empty

A string value, specifying a URL where the client web browser will navigate.

|

Remarks

Use the NavigateUrl property to specify a URL to which the client web browser navigates whenever the current node is clicked.

Note

If the NavigateUrl property is not empty, the tree view implements a default navigation to the specified URL even if the ASPxClientTreeView.NodeClick event handler provides a custom scenario.

Example

The code below adds a node with the default settings to the ASPxTreeView’s child collection, and then initializes its main properties.

The image below shows the result.

csharp
using DevExpress.Web.ASPxTreeView;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e) {
        TreeViewNode node = ASPxTreeView1.Nodes.Add();
        node.Text = "Home";
        node.Image.Url = "~/Images/Home.png";
        node.Name = "Home page";
        node.NavigateUrl = "https://www.devexpress.com/";
        node.Target = "_blank";
        node.ToolTip = "DevEx Home Page";
    }
}
aspx
<dx:ASPxTreeView ID="ASPxTreeView1" runat="server">
</dx:ASPxTreeView>

See Also

Tree View

TreeViewNode Class

TreeViewNode Members

DevExpress.Web Namespace