Back to Devexpress

TreeViewNode.Target Property

aspnet-devexpress-dot-web-dot-treeviewnode-1d242b9b.md

latest2.8 KB
Original Source

TreeViewNode.Target Property

Gets or sets the window or frame to which to target the contents of the URL associated with the current node.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

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

Property Value

TypeDefaultDescription
StringString.Empty

A string which identifies the window or frame to which to target the URL content.

|

Remarks

When the node’s link is clicked, the client web browser navigates to the specified URL, and displays it in the window or frame specified by the Target property. The available values of the property are listed in the table below.

MemberDescription
nameThe name of the target window or frame.
_blankLoad the linked document into a new blank window. This window is not named.
_parentLoad the linked document into the immediate parent of the document the link is in.
_searchLoad the linked document into the browser search pane.
_selfLoad the linked document into the window in which the link was clicked (the active window).
_topLoad the linked document into the topmost window.

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