System.Web.UI.WebControls Namespace TreeNode Class
.NET Framework version 2.0
Initializes a new instance of the TreeNode class with the specified node text and value.
[ VB ]
Overloads Public Sub New ( _
ByVal text As String, _
ByVal value As String _
)
[ C# ]
public TreeNode (
string text,
string value
);
[ C++ ]
public: TreeNode (
String* text,
String* value
);
[ JScript ]
public function TreeNode (
text : String,
value : String
);
- text
- The text to display for the TreeNode.
- value
- The value associated with the TreeNode.
Use this constructor to initialize a new instance of the TreeNode class using the specified node text and value.
The following table shows initial property values for an instance of TreeNode.
Property |
Initial Value |
Text |
The value of the text parameter. |
Value |
The value of the value parameter. |
The following example shows how to programmatically add root node objects to the Nodes collection of a TreeView control using this constructor.
TreeNode newNode = new TreeNode ( nodeText, nodeValue );
newNode.NavigateUrl = webPageUrl;
myTreeView.Nodes.Add ( newNode );
Dim newNode As New TreeNode ( nodeText, nodeValue );
newNode.NavigateUrl = webPageUrl;
myTreeView.Nodes.Add ( newNode ); |
|
C# |
VB |
Show me
TreeNode Members TreeNode Constructor Overload List