asp.net.ph

TreeNode.NavigateUrl Property

System.Web.UI.WebControls Namespace   TreeNode Class


.NET Framework version 2.0

Sets or retrieves the destination of the TreeNode control.

Syntax


Inline <asp:treenode navigateurl = strUrl ... >
Script TreeNode.NavigateUrl [ = strUrl ]

Property Value


strUrl String specifying the URL to link to when the treenode is clicked.

The property is read/write with no default value.

Remarks

Use the NavigateUrl property to specify or determine the URL to navigate to when the TreeNode control is clicked.

A node can be in one of two modes: selection mode or navigation mode. A node is in navigation mode when the NavigateUrl property for the node is set to a value other than an empty string. Otherwise, the node is in selection mode, wherein the user can select a node by clicking on the node text.

When a node is in navigation mode, all selection events are disabled for that node. Clicking the node in navigation mode takes the user to the specified URL.

By default, the linked content is opened in the current window or frame, or in the window or frame specified by the TreeView control's Target ptoperty. You can, however, optionally set the individual node's Target property to specify the window or frame in which to display the linked content.

Example

The following example demonstrates how to programmatically set the NavigateUrl property to specify the URL to navigate to when the user clicks a TreeNode.

TreeNode newNode = new TreeNode ( row [ "catalog" ].ToString ( ), row [ "tops" ].ToString ( ) );
newNode.NavigateUrl = string.Format ( "~/shop/catalogs.aspx?mode={0}", row [ "mode" ] );
myTreeView.Nodes.Add ( newNode );
  C# VB

 Show me 

See Also

TreeNode Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph