Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
2403 lines (2075 sloc) 144 KB
<Type Name="TreeNode" FullName="System.Web.UI.WebControls.TreeNode">
<TypeSignature Language="C#" Value="public class TreeNode : ICloneable, System.Web.UI.IStateManager" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit TreeNode extends System.Object implements class System.ICloneable, class System.Web.UI.IStateManager" />
<TypeSignature Language="DocId" Value="T:System.Web.UI.WebControls.TreeNode" />
<TypeSignature Language="VB.NET" Value="Public Class TreeNode&#xA;Implements ICloneable, IStateManager" />
<TypeSignature Language="C++ CLI" Value="public ref class TreeNode : ICloneable, System::Web::UI::IStateManager" />
<TypeSignature Language="F#" Value="type TreeNode = class&#xA; interface IStateManager&#xA; interface ICloneable" />
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.ICloneable</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.Web.UI.IStateManager</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute>
<AttributeName>System.Web.UI.ParseChildren(true, "ChildNodes")</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Represents a node in the <see cref="T:System.Web.UI.WebControls.TreeView" /> control.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.TreeView> control is made up of nodes. Each entry in the tree is called a node and is represented by a <xref:System.Web.UI.WebControls.TreeNode> object. A node that contains other nodes is called a *parent node*. A node that is contained by another node is called a *child node*. A node that has no child nodes is called a *leaf node*. A node that is not contained by any other node but is the ancestor to all the other nodes is the *root node*. A node can be both a parent and a child, but root, parent, and leaf nodes are mutually exclusive. Several visual and behavioral properties of nodes are determined by whether a node is a *root*, *parent*, or *leaf* node.
Although a typical tree has only one root node, the <xref:System.Web.UI.WebControls.TreeView> control allows you to add multiple root nodes to your tree structure. This is useful when you want to display item listings without displaying a single main root node, as in a list of product categories.
A node primarily stores data in two properties, the <xref:System.Web.UI.WebControls.TreeNode.Text%2A> property and the <xref:System.Web.UI.WebControls.TreeNode.Value%2A> property. The value of the <xref:System.Web.UI.WebControls.TreeNode.Text%2A> property is displayed in the <xref:System.Web.UI.WebControls.TreeView> control, and the <xref:System.Web.UI.WebControls.TreeNode.Value%2A> property is used to store any additional data about the node, such as data used for handling postback events. A node also stores the path from the node to its root node in the <xref:System.Web.UI.WebControls.TreeNode.ValuePath%2A> property. The <xref:System.Web.UI.WebControls.TreeNode.ValuePath%2A> property indicates the node's position relative to the root node.
> [!NOTE]
> Nodes at the same level must each have a unique value for the <xref:System.Web.UI.WebControls.TreeNode.Value%2A> property; the <xref:System.Web.UI.WebControls.TreeView> control cannot distinguish between different nodes at the same level that have the same value. In this scenario, if the user clicks a node that has a duplicate value, the node that appears first in the <xref:System.Web.UI.WebControls.TreeView> control is selected.
A <xref:System.Web.UI.WebControls.TreeNode> object is made up of the following four user interface (UI) elements, which can be customized or hidden:
- An expansion node indicator icon used to show whether the node is expanded, collapsed, or non-expandable.
- An optional check box associated with the node.
- An optional node image.
- The node text.
You can specify a custom image for the expandable, collapsible, and non-expandable node indicators by setting the <xref:System.Web.UI.WebControls.TreeView.ExpandImageUrl%2A>, <xref:System.Web.UI.WebControls.TreeView.CollapseImageUrl%2A>, and <xref:System.Web.UI.WebControls.TreeView.NoExpandImageUrl%2A> properties of the <xref:System.Web.UI.WebControls.TreeView> class. The expansion node indicator icons can even be hidden entirely by setting the <xref:System.Web.UI.WebControls.TreeView.ShowExpandCollapse%2A> property of the <xref:System.Web.UI.WebControls.TreeView> class to `false`.
To display a check box next to a node, set the <xref:System.Web.UI.WebControls.TreeView.ShowCheckBoxes%2A> property of the <xref:System.Web.UI.WebControls.TreeView> class. When the <xref:System.Web.UI.WebControls.TreeView.ShowCheckBoxes%2A> property is set to a value other than `TreeNodeType.Node`, check boxes are displayed next to the specified node type. You can selectively override the check box of an individual node by setting the node's <xref:System.Web.UI.WebControls.TreeNode.ShowCheckBox%2A> property. When a check box is displayed, use the <xref:System.Web.UI.WebControls.TreeNode.Checked%2A> property to determine whether the check box is selected.
You can display an image in a node by setting the <xref:System.Web.UI.WebControls.TreeNode.ImageUrl%2A> property. This image is displayed next to the node text.
The text of a node in the <xref:System.Web.UI.WebControls.TreeView> control can be in one of two modes: selection mode or navigation mode. By default, a node is in selection mode. To put a node into navigation mode, set the node's <xref:System.Web.UI.WebControls.TreeNode.NavigateUrl%2A> property to a value other than an empty string (""). To put a node into selection mode, set the node's <xref:System.Web.UI.WebControls.TreeNode.NavigateUrl%2A> property to an empty string.
> [!NOTE]
> Some Internet browsers have a limitation that can affect the performance of the <xref:System.Web.UI.WebControls.TreeView> control. For example, Microsoft Internet Explorer 6.0 has a URL character limit of 2067 characters that it posts. If the number of characters in a URL of a node is larger than that number, expanding that node will fail and no exception is thrown.
By default, clicking a node that is in selection mode posts the page back to the server and raises the <xref:System.Web.UI.WebControls.TreeView.SelectedNodeChanged> event. You can optionally specify a different event to raise by setting the node's `SelectAction` property. For more information, see <xref:System.Web.UI.WebControls.TreeNode.SelectAction%2A>. To determine which node was clicked in selection mode, use the <xref:System.Web.UI.WebControls.TreeView.SelectedNode%2A> property of the <xref:System.Web.UI.WebControls.TreeView> control.
When a node is in navigation mode, all selection events are disabled for that node. Clicking the node in navigation mode directs the user to the specified URL. You can optionally set the <xref:System.Web.UI.WebControls.TreeNode.Target%2A> property to specify the window or frame in which to display the linked content.
The <xref:System.Web.UI.WebControls.TreeNode> class contains several properties that are used to store the state of the node. Use the <xref:System.Web.UI.WebControls.TreeNode.Selected%2A> property to determine whether a node is selected. To determine whether the node is expanded, use the <xref:System.Web.UI.WebControls.TreeNode.Expanded%2A> property. The <xref:System.Web.UI.WebControls.TreeNode.DataBound%2A> property is used to determine whether a node is bound to data. When a node is bound to data, you can access the underlying data item by using the <xref:System.Web.UI.WebControls.TreeNode.DataItem%2A> property.
The class provides several properties that help to determine the position of a node relative to other nodes in the tree. Use the <xref:System.Web.UI.WebControls.TreeNode.Depth%2A> property to determine the depth of the node. You can get the delimited list of nodes from the current node to its root node by using the <xref:System.Web.UI.WebControls.TreeNode.ValuePath%2A> property. To determine the node's parent node, use the <xref:System.Web.UI.WebControls.TreeNode.Parent%2A> property. Child nodes are accessed using the <xref:System.Web.UI.WebControls.TreeNode.ChildNodes%2A> collection.
Sometimes, it is not practical to statically predefine the tree structure due to data size or custom content that depends on user input. Because of this, the <xref:System.Web.UI.WebControls.TreeView> control supports dynamic node population. A node can be populated at run time when it is expanded. Note that you can get unexpected behavior if you persist asynchronously created nodes. For example, if you use a background worker thread to populate nodes asynchronously, the node tree might not be populated immediately though the control proceeds with the rest of the page life cycle. On postback, the delayed creation of the nodes can cause problems when the control's view state is loaded but the node tree is not fully populated. For more information on dynamic node population, see the <xref:System.Web.UI.WebControls.TreeNode.PopulateOnDemand%2A> property.
For a list of initial property values for an instance of <xref:System.Web.UI.WebControls.TreeNode>, see the <xref:System.Web.UI.WebControls.TreeNode.%23ctor%2A> constructor.
## Examples
The following code example demonstrates how to set up the frames for the next code example.
[!code-aspx-csharp[TreeViewFrameSet#1](~/samples/snippets/csharp/VS_Snippets_WebNet/TreeViewFrameSet/CS/framecs.aspx#1)]
[!code-aspx-vb[TreeViewFrameSet#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/TreeViewFrameSet/VB/framevb.aspx#1)]
The following code example demonstrates how to use declarative syntax to create <xref:System.Web.UI.WebControls.TreeNode> objects in the <xref:System.Web.UI.WebControls.TreeView> control. This example is used within the frameset of the previous example to display a table of contents.
[!code-aspx-csharp[TreeViewFrameExample#1](~/samples/snippets/csharp/VS_Snippets_WebNet/TreeViewFrameExample/CS/treeviewframecs.aspx#1)]
[!code-aspx-vb[TreeViewFrameExample#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/TreeViewFrameExample/VB/treeviewframevb.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TreeView" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.ChildNodes" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.ImageUrl" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.NavigateUrl" />
<altmember cref="P:System.Web.UI.WebControls.TreeView.Nodes" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.Parent" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.PopulateOnDemand" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.Target" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.Text" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.Value" />
</Docs>
<Members>
<MemberGroup MemberName=".ctor">
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Web.UI.WebControls.TreeNode" /> class.</summary>
</Docs>
</MemberGroup>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public TreeNode ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.TreeNode.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; TreeNode();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Web.UI.WebControls.TreeNode" /> class without text or a value.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use this constructor to initialize a new instance of the <xref:System.Web.UI.WebControls.TreeNode> class using the default values.
> [!NOTE]
> When this constructor is used, all properties in the <xref:System.Web.UI.WebControls.TreeNode> object are set to their default values. Be sure to set the properties, as necessary, after creating the object.
## Examples
The following code example demonstrates how to use this constructor to dynamically add a node to the <xref:System.Web.UI.WebControls.TreeView> control.
[!code-aspx-csharp[TreeNodeCtor#1](~/samples/snippets/csharp/VS_Snippets_WebNet/TreeNodeCtor/CS/treenodectorcs.aspx#1)]
[!code-aspx-vb[TreeNodeCtor#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/TreeNodeCtor/VB/treenodectorvb.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TreeView" />
<altmember cref="P:System.Web.UI.WebControls.TreeView.Nodes" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.ChildNodes" />
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public TreeNode (string text);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string text) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.TreeNode.#ctor(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (text As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; TreeNode(System::String ^ text);" />
<MemberSignature Language="F#" Value="new System.Web.UI.WebControls.TreeNode : string -&gt; System.Web.UI.WebControls.TreeNode" Usage="new System.Web.UI.WebControls.TreeNode text" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="text" Type="System.String" />
</Parameters>
<Docs>
<param name="text">The text that is displayed in the <see cref="T:System.Web.UI.WebControls.TreeView" /> control for the node.</param>
<summary>Initializes a new instance of the <see cref="T:System.Web.UI.WebControls.TreeNode" /> class using the specified text.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use this constructor to initialize a new instance of the <xref:System.Web.UI.WebControls.TreeNode> class using the text specified by the `text` parameter.
The following table shows the initial property value for an instance of <xref:System.Web.UI.WebControls.TreeNode>.
|Property|Initial value|
|--------------|-------------------|
|<xref:System.Web.UI.WebControls.TreeNode.Text%2A>|The value of the `text` parameter.|
## Examples
The following code example demonstrates how to use this constructor to dynamically add a node to the <xref:System.Web.UI.WebControls.TreeView> control.
[!code-aspx-csharp[TreeNodeCtor#1](~/samples/snippets/csharp/VS_Snippets_WebNet/TreeNodeCtor/CS/treenodectorcs.aspx#1)]
[!code-aspx-vb[TreeNodeCtor#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/TreeNodeCtor/VB/treenodectorvb.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TreeView" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.Text" />
<altmember cref="P:System.Web.UI.WebControls.TreeView.Nodes" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.ChildNodes" />
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public TreeNode (string text, string value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string text, string value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.TreeNode.#ctor(System.String,System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (text As String, value As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; TreeNode(System::String ^ text, System::String ^ value);" />
<MemberSignature Language="F#" Value="new System.Web.UI.WebControls.TreeNode : string * string -&gt; System.Web.UI.WebControls.TreeNode" Usage="new System.Web.UI.WebControls.TreeNode (text, value)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="text" Type="System.String" />
<Parameter Name="value" Type="System.String" />
</Parameters>
<Docs>
<param name="text">The text that is displayed in the <see cref="T:System.Web.UI.WebControls.TreeView" /> control for the node.</param>
<param name="value">The supplemental data associated with the node, such as data used for handling postback events.</param>
<summary>Initializes a new instance of the <see cref="T:System.Web.UI.WebControls.TreeNode" /> class using the specified text and value.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use this constructor to initialize a new instance of the <xref:System.Web.UI.WebControls.TreeNode> class using the text and value specified by the `text` and `value` parameters, respectively.
The following table shows initial property values for an instance of <xref:System.Web.UI.WebControls.TreeNode>.
|Property|Initial value|
|--------------|-------------------|
|<xref:System.Web.UI.WebControls.TreeNode.Text%2A>|The value of the `text` parameter.|
|<xref:System.Web.UI.WebControls.TreeNode.Value%2A>|The value of the `value` parameter.|
## Examples
The following code example demonstrates how to use this constructor to dynamically add a node to the <xref:System.Web.UI.WebControls.TreeView> control.
[!code-aspx-csharp[TreeNodeCtor#1](~/samples/snippets/csharp/VS_Snippets_WebNet/TreeNodeCtor/CS/treenodectorcs.aspx#1)]
[!code-aspx-vb[TreeNodeCtor#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/TreeNodeCtor/VB/treenodectorvb.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TreeView" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.Text" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.Value" />
<altmember cref="P:System.Web.UI.WebControls.TreeView.Nodes" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.ChildNodes" />
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected internal TreeNode (System.Web.UI.WebControls.TreeView owner, bool isRoot);" />
<MemberSignature Language="ILAsm" Value=".method familyorassemblyhidebysig specialname rtspecialname instance void .ctor(class System.Web.UI.WebControls.TreeView owner, bool isRoot) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.TreeNode.#ctor(System.Web.UI.WebControls.TreeView,System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Protected Friend Sub New (owner As TreeView, isRoot As Boolean)" />
<MemberSignature Language="C++ CLI" Value="protected public:&#xA; TreeNode(System::Web::UI::WebControls::TreeView ^ owner, bool isRoot);" />
<MemberSignature Language="F#" Value="new System.Web.UI.WebControls.TreeNode : System.Web.UI.WebControls.TreeView * bool -&gt; System.Web.UI.WebControls.TreeNode" Usage="new System.Web.UI.WebControls.TreeNode (owner, isRoot)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="owner" Type="System.Web.UI.WebControls.TreeView" />
<Parameter Name="isRoot" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="owner">The <see cref="T:System.Web.UI.WebControls.TreeView" /> that will contain the new <see cref="T:System.Web.UI.WebControls.TreeNode" />.</param>
<param name="isRoot">
<see langword="true" /> if the <see cref="T:System.Web.UI.WebControls.TreeNode" /> is a root node; otherwise, <see langword="false" />.</param>
<summary>Initializes a new instance of the <see cref="T:System.Web.UI.WebControls.TreeNode" /> class using the specified owner.</summary>
<remarks>To be added.</remarks>
<altmember cref="T:System.Web.UI.WebControls.TreeNodeTypes" />
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public TreeNode (string text, string value, string imageUrl);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string text, string value, string imageUrl) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.TreeNode.#ctor(System.String,System.String,System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (text As String, value As String, imageUrl As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; TreeNode(System::String ^ text, System::String ^ value, System::String ^ imageUrl);" />
<MemberSignature Language="F#" Value="new System.Web.UI.WebControls.TreeNode : string * string * string -&gt; System.Web.UI.WebControls.TreeNode" Usage="new System.Web.UI.WebControls.TreeNode (text, value, imageUrl)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="text" Type="System.String" />
<Parameter Name="value" Type="System.String" />
<Parameter Name="imageUrl" Type="System.String" />
</Parameters>
<Docs>
<param name="text">The text that is displayed in the <see cref="T:System.Web.UI.WebControls.TreeView" /> control for the node.</param>
<param name="value">The supplemental data associated with the node, such as data used for handling postback events.</param>
<param name="imageUrl">The URL to an image that is displayed next to the node.</param>
<summary>Initializes a new instance of the <see cref="T:System.Web.UI.WebControls.TreeNode" /> class using the specified text, value, and image URL.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use this constructor to initialize a new instance of the <xref:System.Web.UI.WebControls.TreeNode> class using the text, value, and image URL specified by the `text`, `value`, and `imageUrl` parameters, respectively.
The following table shows initial property values for an instance of <xref:System.Web.UI.WebControls.TreeNode>.
|Property|Initial value|
|--------------|-------------------|
|<xref:System.Web.UI.WebControls.TreeNode.Text%2A>|The value of the `text` parameter.|
|<xref:System.Web.UI.WebControls.TreeNode.Value%2A>|The value of the `value` parameter.|
|<xref:System.Web.UI.WebControls.TreeNode.ImageUrl%2A>|The value of the `imageUrl` parameter.|
## Examples
The following code example demonstrates how to use this constructor to dynamically add a node to the <xref:System.Web.UI.WebControls.TreeView> control.
[!code-aspx-csharp[TreeNodeCtor#1](~/samples/snippets/csharp/VS_Snippets_WebNet/TreeNodeCtor/CS/treenodectorcs.aspx#1)]
[!code-aspx-vb[TreeNodeCtor#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/TreeNodeCtor/VB/treenodectorvb.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TreeView" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.Text" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.Value" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.ImageUrl" />
<altmember cref="P:System.Web.UI.WebControls.TreeView.Nodes" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.ChildNodes" />
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public TreeNode (string text, string value, string imageUrl, string navigateUrl, string target);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string text, string value, string imageUrl, string navigateUrl, string target) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.TreeNode.#ctor(System.String,System.String,System.String,System.String,System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (text As String, value As String, imageUrl As String, navigateUrl As String, target As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; TreeNode(System::String ^ text, System::String ^ value, System::String ^ imageUrl, System::String ^ navigateUrl, System::String ^ target);" />
<MemberSignature Language="F#" Value="new System.Web.UI.WebControls.TreeNode : string * string * string * string * string -&gt; System.Web.UI.WebControls.TreeNode" Usage="new System.Web.UI.WebControls.TreeNode (text, value, imageUrl, navigateUrl, target)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="text" Type="System.String" />
<Parameter Name="value" Type="System.String" />
<Parameter Name="imageUrl" Type="System.String" />
<Parameter Name="navigateUrl" Type="System.String" />
<Parameter Name="target" Type="System.String" />
</Parameters>
<Docs>
<param name="text">The text that is displayed in the <see cref="T:System.Web.UI.WebControls.TreeView" /> control for the node.</param>
<param name="value">The supplemental data associated with the node, such as data used for handling postback events.</param>
<param name="imageUrl">The URL to an image that is displayed next to the node.</param>
<param name="navigateUrl">The URL to link to when the node is clicked.</param>
<param name="target">The target window or frame in which to display the Web page content linked to when the node is clicked.</param>
<summary>Initializes a new instance of the <see cref="T:System.Web.UI.WebControls.TreeNode" /> class using the specified text, value, image URL, navigation URL, and target.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use this constructor to initialize a new instance of the <xref:System.Web.UI.WebControls.TreeNode> class using the text, value, image and navigation URLs, and display target specified by the `text`, `value`, `imageUrl`, `navigateUrl`, and `target` parameters, respectively.
The following table shows initial property values for an instance of <xref:System.Web.UI.WebControls.TreeNode>.
|Property|Initial value|
|--------------|-------------------|
|<xref:System.Web.UI.WebControls.TreeNode.Text%2A>|The value of the `text` parameter.|
|<xref:System.Web.UI.WebControls.TreeNode.Value%2A>|The value of the `value` parameter.|
|<xref:System.Web.UI.WebControls.TreeNode.ImageUrl%2A>|The value of the `imageUrl` parameter.|
|<xref:System.Web.UI.WebControls.TreeNode.NavigateUrl%2A>|The value of the `navigateUrl` parameter.|
|<xref:System.Web.UI.WebControls.TreeNode.Target%2A>|The value of the `target` parameter.|
## Examples
The following code example demonstrates how to use this constructor to dynamically add a node to the <xref:System.Web.UI.WebControls.TreeView> control.
[!code-aspx-csharp[TreeNodeCtor#1](~/samples/snippets/csharp/VS_Snippets_WebNet/TreeNodeCtor/CS/treenodectorcs.aspx#1)]
[!code-aspx-vb[TreeNodeCtor#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/TreeNodeCtor/VB/treenodectorvb.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TreeView" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.Text" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.Value" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.ImageUrl" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.NavigateUrl" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.Target" />
<altmember cref="P:System.Web.UI.WebControls.TreeView.Nodes" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.ChildNodes" />
</Docs>
</Member>
<Member MemberName="Checked">
<MemberSignature Language="C#" Value="public bool Checked { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool Checked" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.TreeNode.Checked" />
<MemberSignature Language="VB.NET" Value="Public Property Checked As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool Checked { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.Checked : bool with get, set" Usage="System.Web.UI.WebControls.TreeNode.Checked" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value that indicates whether the node's check box is selected.</summary>
<value>
<see langword="true" /> if the node's check box is selected; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When a node displays a check box, the <xref:System.Web.UI.WebControls.TreeNode.Checked%2A> property is commonly used to specify whether the check box is selected. When the check box associated with a node is selected, the node is automatically added to the <xref:System.Web.UI.WebControls.TreeView.CheckedNodes%2A> collection of the <xref:System.Web.UI.WebControls.TreeView> control. The <xref:System.Web.UI.WebControls.TreeNode.Checked%2A> property can also be used to determine whether the check box is selected.
> [!NOTE]
> It is more common to determine which nodes in the <xref:System.Web.UI.WebControls.TreeView> control have their check boxes selected by iterating through the <xref:System.Web.UI.WebControls.TreeView.CheckedNodes%2A> collection.
The value of this property is stored in view state.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.TreeNode.Checked%2A> property to specify whether a node's check box is selected. It initializes the check boxes of nodes with a depth of one to a selected state. For this example to work correctly, you must copy the sample XML data below to a file named Newsgroup.xml.
[!code-aspx-csharp[TreeNodeChecked#1](~/samples/snippets/csharp/VS_Snippets_WebNet/TreeNodeChecked/CS/treenodecheckedcs.aspx#1)]
[!code-aspx-vb[TreeNodeChecked#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/TreeNodeChecked/VB/treenodecheckedvb.aspx#1)]
The following code is sample XML data for the previous example.
```
<category name="news.microsoft.com">
<group name="microsoft.public.dotnet.framework.aspnet"/>
<group name="microsoft.public.dotnet.framework.aspnet.mobile"/>
<group name="microsoft.public.dotnet.framework.aspnet.webservices"/>
</category>
```
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TreeView" />
<altmember cref="P:System.Web.UI.WebControls.TreeView.CheckedNodes" />
</Docs>
</Member>
<Member MemberName="ChildNodes">
<MemberSignature Language="C#" Value="public System.Web.UI.WebControls.TreeNodeCollection ChildNodes { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Web.UI.WebControls.TreeNodeCollection ChildNodes" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.TreeNode.ChildNodes" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property ChildNodes As TreeNodeCollection" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Web::UI::WebControls::TreeNodeCollection ^ ChildNodes { System::Web::UI::WebControls::TreeNodeCollection ^ get(); };" />
<MemberSignature Language="F#" Value="member this.ChildNodes : System.Web.UI.WebControls.TreeNodeCollection" Usage="System.Web.UI.WebControls.TreeNode.ChildNodes" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(null)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.MergableProperty(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerDefaultProperty)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Web.UI.WebControls.TreeNodeCollection</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a <see cref="T:System.Web.UI.WebControls.TreeNodeCollection" /> collection that contains the first-level child nodes of the current node.</summary>
<value>A <see cref="T:System.Web.UI.WebControls.TreeNodeCollection" /> that contains the first-level child nodes of the current node.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.TreeNode.ChildNodes%2A> property to get a <xref:System.Web.UI.WebControls.TreeNodeCollection> collection that contains the first-level child nodes of the current node. This collection is commonly used to iterate through all the first-level child nodes, or to access a specific first-level child node of the current node.
The <xref:System.Web.UI.WebControls.TreeNode.ChildNodes%2A> property can also be used to programmatically manage the first-level child nodes in the current node. You can add, insert, remove, and retrieve <xref:System.Web.UI.WebControls.TreeNode> objects from the collection. Any updates to the collection will automatically be reflected in the <xref:System.Web.UI.WebControls.TreeView> control the next time the page is refreshed.
To access child nodes further down the tree, use the <xref:System.Web.UI.WebControls.TreeNode.ChildNodes%2A> property of the next-level child node to navigate down the node levels.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.TreeNode.ChildNodes%2A> property to traverse the tree.
[!code-aspx-csharp[TreeNodeCollectionCount#1](~/samples/snippets/csharp/VS_Snippets_WebNet/TreeNodeCollectionCount/CS/treenodecollectioncountcs.aspx#1)]
[!code-aspx-vb[TreeNodeCollectionCount#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/TreeNodeCollectionCount/VB/treenodecollectioncountvb.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TreeView" />
<altmember cref="T:System.Web.UI.WebControls.TreeNodeCollection" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.Parent" />
<altmember cref="P:System.Web.UI.WebControls.TreeView.Nodes" />
</Docs>
</Member>
<Member MemberName="Clone">
<MemberSignature Language="C#" Value="protected virtual object Clone ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance object Clone() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.TreeNode.Clone" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function Clone () As Object" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual System::Object ^ Clone();" />
<MemberSignature Language="F#" Value="abstract member Clone : unit -&gt; obj&#xA;override this.Clone : unit -&gt; obj" Usage="treeNode.Clone " />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.ICloneable.Clone</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Creates a new instance of the <see cref="T:System.Web.UI.WebControls.TreeNode" /> class with the properties of the current <see cref="T:System.Web.UI.WebControls.TreeNode" /> instance.</summary>
<returns>A new instance of <see cref="T:System.Web.UI.WebControls.TreeNode" /> with the properties of the current <see cref="T:System.Web.UI.WebControls.TreeNode" /> instance.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This is a helper method that supports the <xref:System.ICloneable> interface implemented by <xref:System.Web.UI.WebControls.TreeNode>.
]]></format>
</remarks>
<altmember cref="T:System.ICloneable" />
</Docs>
</Member>
<Member MemberName="Collapse">
<MemberSignature Language="C#" Value="public void Collapse ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Collapse() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.TreeNode.Collapse" />
<MemberSignature Language="VB.NET" Value="Public Sub Collapse ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Collapse();" />
<MemberSignature Language="F#" Value="member this.Collapse : unit -&gt; unit" Usage="treeNode.Collapse " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Collapses the current tree node.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.TreeNode.Collapse%2A> method to conveniently collapse the current node.
> [!NOTE]
> As an alternative, you can also set the <xref:System.Web.UI.WebControls.TreeNode.Expanded%2A> property to `false`.
To collapse the current node and all its child nodes, consider using the <xref:System.Web.UI.WebControls.TreeNode.CollapseAll%2A> method.
<xref:System.Web.UI.WebControls.TreeView.CollapseAll%2A> will collapse all the nodes in the entire tree.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.TreeNode.Collapse%2A> method to programmatically collapse a node in the <xref:System.Web.UI.WebControls.TreeView> control. For this example to work correctly, you must copy the sample XML data below to a file named Book.xml.
[!code-aspx-csharp[TreeNodeExpand#1](~/samples/snippets/csharp/VS_Snippets_WebNet/TreeNodeExpand/CS/treenodeexpandcs.aspx#1)]
[!code-aspx-vb[TreeNodeExpand#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/TreeNodeExpand/VB/treenodeexpandvb.aspx#1)]
The following code is sample XML data for the previous example.
```
<Book Title="Book Title">
<Chapter Heading="Chapter 1">
<Section Heading="Section 1">
</Section>
<Section Heading="Section 2">
</Section>
</Chapter>
<Chapter Heading="Chapter 2">
<Section Heading="Section 1">
</Section>
</Chapter>
</Book>
```
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TreeView" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.Expanded" />
<altmember cref="M:System.Web.UI.WebControls.TreeNode.CollapseAll" />
<altmember cref="M:System.Web.UI.WebControls.TreeNode.Expand" />
<altmember cref="M:System.Web.UI.WebControls.TreeNode.ExpandAll" />
<altmember cref="M:System.Web.UI.WebControls.TreeView.CollapseAll" />
</Docs>
</Member>
<Member MemberName="CollapseAll">
<MemberSignature Language="C#" Value="public void CollapseAll ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void CollapseAll() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.TreeNode.CollapseAll" />
<MemberSignature Language="VB.NET" Value="Public Sub CollapseAll ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void CollapseAll();" />
<MemberSignature Language="F#" Value="member this.CollapseAll : unit -&gt; unit" Usage="treeNode.CollapseAll " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Collapses the current node and all its child nodes.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.TreeNode.CollapseAll%2A> method to conveniently collapse the current node and all its child nodes.
> [!NOTE]
> As an alternative, you can also set the <xref:System.Web.UI.WebControls.TreeNode.Expanded%2A> property of the current node and each of its child nodes to `false`.
To collapse only the current node, consider using the <xref:System.Web.UI.WebControls.TreeNode.Collapse%2A> method.
<xref:System.Web.UI.WebControls.TreeView.CollapseAll%2A> will collapse all the nodes in the entire tree.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.TreeNode.CollapseAll%2A> method to programmatically collapse a node and all its child nodes in the <xref:System.Web.UI.WebControls.TreeView> control. For this example to work correctly, you must copy the sample XML data below to a file named Book.xml.
[!code-aspx-csharp[TreeNodeExpandAll#1](~/samples/snippets/csharp/VS_Snippets_WebNet/TreeNodeExpandAll/CS/treenodeexpandallcs.aspx#1)]
[!code-aspx-vb[TreeNodeExpandAll#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/TreeNodeExpandAll/VB/treenodeexpandallvb.aspx#1)]
The following code is sample XML data for the previous example.
```
<Book Title="Book Title">
<Chapter Heading="Chapter 1">
<Section Heading="Section 1">
</Section>
<Section Heading="Section 2">
</Section>
</Chapter>
<Chapter Heading="Chapter 2">
<Section Heading="Section 1">
</Section>
</Chapter>
</Book>
```
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TreeView" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.Expanded" />
<altmember cref="M:System.Web.UI.WebControls.TreeNode.Collapse" />
<altmember cref="M:System.Web.UI.WebControls.TreeNode.Expand" />
<altmember cref="M:System.Web.UI.WebControls.TreeNode.ExpandAll" />
<altmember cref="M:System.Web.UI.WebControls.TreeView.CollapseAll" />
</Docs>
</Member>
<Member MemberName="DataBound">
<MemberSignature Language="C#" Value="public bool DataBound { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool DataBound" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.TreeNode.DataBound" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property DataBound As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool DataBound { bool get(); };" />
<MemberSignature Language="F#" Value="member this.DataBound : bool" Usage="System.Web.UI.WebControls.TreeNode.DataBound" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a value that indicates whether the node was created through data binding.</summary>
<value>
<see langword="true" /> if the node was created through data binding; otherwise, <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.TreeNode.DataBound%2A> property is used to programmatically determine whether the node was created through data binding. Because dynamic and static content cannot be mixed in the same node, this property is commonly used when populating a <xref:System.Web.UI.WebControls.TreeView> control dynamically to determine whether the node contains static content.
The value of this property is stored in view state.
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TreeView" />
</Docs>
</Member>
<Member MemberName="DataItem">
<MemberSignature Language="C#" Value="public object DataItem { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance object DataItem" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.TreeNode.DataItem" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property DataItem As Object" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Object ^ DataItem { System::Object ^ get(); };" />
<MemberSignature Language="F#" Value="member this.DataItem : obj" Usage="System.Web.UI.WebControls.TreeNode.DataItem" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(null)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the data item that is bound to the control.</summary>
<value>A <see cref="T:System.Object" /> that represents the data item that is bound to the control. The default value is <see langword="null" />, which indicates that the node is not bound to any data item.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When the <xref:System.Web.UI.WebControls.TreeView> control is bound to a data source, such as an <xref:System.Web.UI.WebControls.XmlDataSource> object, this property is set to the data item that is bound to this specific node. This property is commonly used to access the values of the data item.
> [!NOTE]
> This property is available only after data binding has occurred.
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TreeView" />
<altmember cref="T:System.Web.UI.WebControls.XmlDataSource" />
</Docs>
</Member>
<Member MemberName="DataPath">
<MemberSignature Language="C#" Value="public string DataPath { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance string DataPath" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.TreeNode.DataPath" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property DataPath As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ DataPath { System::String ^ get(); };" />
<MemberSignature Language="F#" Value="member this.DataPath : string" Usage="System.Web.UI.WebControls.TreeNode.DataPath" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue("")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the path to the data bound to the node.</summary>
<value>The path to the data bound to the node. This value comes from the hierarchical data source control to which the <see cref="T:System.Web.UI.WebControls.TreeView" /> control is bound. The default value is an empty string ("").</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.TreeNode.DataPath%2A> property value is commonly used when calling the <xref:System.Web.UI.IHierarchicalDataSource.GetHierarchicalView%2A?displayProperty=nameWithType> method to provide the path to the data bound to the current node. This method then returns a <xref:System.Web.UI.HierarchicalDataSourceView?displayProperty=nameWithType> object that contains the data at the specified path.
The value of this property is stored in view state.
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TreeView" />
<altmember cref="M:System.Web.UI.HierarchicalDataSourceControl.GetHierarchicalView(System.String)" />
<altmember cref="T:System.Web.UI.HierarchicalDataSourceControl" />
</Docs>
</Member>
<Member MemberName="Depth">
<MemberSignature Language="C#" Value="public int Depth { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 Depth" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.TreeNode.Depth" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Depth As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property int Depth { int get(); };" />
<MemberSignature Language="F#" Value="member this.Depth : int" Usage="System.Web.UI.WebControls.TreeNode.Depth" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the depth of the node.</summary>
<value>The depth of the node.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.TreeNode.Depth%2A> property to determine the depth of the node. The depth represents the number of levels of hierarchy between a node and the root node. For example, a root node has a depth of zero. A child of the root node has a depth of one, and so on.
## Examples
The following code example demonstrates how use the <xref:System.Web.UI.WebControls.TreeNode.Depth%2A> property to determine the depth of a node. It initializes all nodes with a depth of one to a selected state. For this example to work correctly, you must copy the sample XML data below to a file named Newsgroup.xml.
[!code-aspx-csharp[TreeNodeChecked#1](~/samples/snippets/csharp/VS_Snippets_WebNet/TreeNodeChecked/CS/treenodecheckedcs.aspx#1)]
[!code-aspx-vb[TreeNodeChecked#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/TreeNodeChecked/VB/treenodecheckedvb.aspx#1)]
The following code is sample XML data for the previous example.
```
<category name="news.microsoft.com">
<group name="microsoft.public.dotnet.framework.aspnet"/>
<group name="microsoft.public.dotnet.framework.aspnet.mobile"/>
<group name="microsoft.public.dotnet.framework.aspnet.webservices"/>
</category>
```
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TreeView" />
</Docs>
</Member>
<Member MemberName="Expand">
<MemberSignature Language="C#" Value="public void Expand ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Expand() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.TreeNode.Expand" />
<MemberSignature Language="VB.NET" Value="Public Sub Expand ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Expand();" />
<MemberSignature Language="F#" Value="member this.Expand : unit -&gt; unit" Usage="treeNode.Expand " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Expands the current tree node.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.TreeNode.Expand%2A> method to conveniently expand the current node.
> [!NOTE]
> As an alternative, you can also set the <xref:System.Web.UI.WebControls.TreeNode.Expanded%2A> property to `true`.
To expand the current node and all its child nodes, consider using the <xref:System.Web.UI.WebControls.TreeNode.ExpandAll%2A> method.
<xref:System.Web.UI.WebControls.TreeView.ExpandAll%2A> will expand all the nodes in the entire tree.
The value of this property is stored in view state.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.TreeNode.Expand%2A> method to programmatically expand a node in the <xref:System.Web.UI.WebControls.TreeView> control. For this example to work correctly, you must copy the sample XML data below to a file named Book.xml.
[!code-aspx-csharp[TreeNodeExpand#1](~/samples/snippets/csharp/VS_Snippets_WebNet/TreeNodeExpand/CS/treenodeexpandcs.aspx#1)]
[!code-aspx-vb[TreeNodeExpand#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/TreeNodeExpand/VB/treenodeexpandvb.aspx#1)]
The following code is sample XML data for the previous example.
```
<Book Title="Book Title">
<Chapter Heading="Chapter 1">
<Section Heading="Section 1">
</Section>
<Section Heading="Section 2">
</Section>
</Chapter>
<Chapter Heading="Chapter 2">
<Section Heading="Section 1">
</Section>
</Chapter>
</Book>
```
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TreeView" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.Expanded" />
<altmember cref="M:System.Web.UI.WebControls.TreeNode.Collapse" />
<altmember cref="M:System.Web.UI.WebControls.TreeNode.CollapseAll" />
<altmember cref="M:System.Web.UI.WebControls.TreeNode.ExpandAll" />
<altmember cref="M:System.Web.UI.WebControls.TreeView.ExpandAll" />
</Docs>
</Member>
<Member MemberName="ExpandAll">
<MemberSignature Language="C#" Value="public void ExpandAll ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void ExpandAll() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.TreeNode.ExpandAll" />
<MemberSignature Language="VB.NET" Value="Public Sub ExpandAll ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void ExpandAll();" />
<MemberSignature Language="F#" Value="member this.ExpandAll : unit -&gt; unit" Usage="treeNode.ExpandAll " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Expands the current node and all its child nodes.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.TreeNode.ExpandAll%2A> method to conveniently expand the current node and all its child nodes.
> [!NOTE]
> As an alternative, you can also set the <xref:System.Web.UI.WebControls.TreeNode.Expanded%2A> property of the current node and each of its child nodes to `true`.
To expand only the current node, consider using the <xref:System.Web.UI.WebControls.TreeNode.Expand%2A> method.
<xref:System.Web.UI.WebControls.TreeView.ExpandAll%2A> will expand all the nodes in the entire tree.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.TreeNode.ExpandAll%2A> method to programmatically expand a node and all its child nodes in the <xref:System.Web.UI.WebControls.TreeView> control. For this example to work correctly, you must copy the sample XML data below to a file named Book.xml.
[!code-aspx-csharp[TreeNodeExpandAll#1](~/samples/snippets/csharp/VS_Snippets_WebNet/TreeNodeExpandAll/CS/treenodeexpandallcs.aspx#1)]
[!code-aspx-vb[TreeNodeExpandAll#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/TreeNodeExpandAll/VB/treenodeexpandallvb.aspx#1)]
The following code is sample XML data for the previous example.
```
<Book Title="Book Title">
<Chapter Heading="Chapter 1">
<Section Heading="Section 1">
</Section>
<Section Heading="Section 2">
</Section>
</Chapter>
<Chapter Heading="Chapter 2">
<Section Heading="Section 1">
</Section>
</Chapter>
</Book>
```
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TreeView" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.Expanded" />
<altmember cref="M:System.Web.UI.WebControls.TreeNode.Collapse" />
<altmember cref="M:System.Web.UI.WebControls.TreeNode.CollapseAll" />
<altmember cref="M:System.Web.UI.WebControls.TreeNode.Expand" />
<altmember cref="M:System.Web.UI.WebControls.TreeView.ExpandAll" />
</Docs>
</Member>
<Member MemberName="Expanded">
<MemberSignature Language="C#" Value="public Nullable&lt;bool&gt; Expanded { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Nullable`1&lt;bool&gt; Expanded" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.TreeNode.Expanded" />
<MemberSignature Language="VB.NET" Value="Public Property Expanded As Nullable(Of Boolean)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property Nullable&lt;bool&gt; Expanded { Nullable&lt;bool&gt; get(); void set(Nullable&lt;bool&gt; value); };" />
<MemberSignature Language="F#" Value="member this.Expanded : Nullable&lt;bool&gt; with get, set" Usage="System.Web.UI.WebControls.TreeNode.Expanded" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(typeof(System.Nullable`1&lt;System.Boolean&gt;), "")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Nullable&lt;System.Boolean&gt;</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value that indicates whether the node is expanded.</summary>
<value>
<see langword="true" /> if the node is expanded, <see langword="false" /> if the node is not expanded, or <see langword="null" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.TreeNode.Expanded%2A> property to specify or determine whether the node is expanded.
You can expand and collapse a node by calling the <xref:System.Web.UI.WebControls.TreeNode.Expand%2A> and <xref:System.Web.UI.WebControls.TreeNode.Collapse%2A> methods, respectively. You can also expand and collapse a node and all its child nodes by calling the <xref:System.Web.UI.WebControls.TreeNode.ExpandAll%2A> and <xref:System.Web.UI.WebControls.TreeNode.CollapseAll%2A> methods, respectively.
Since the <xref:System.Web.UI.WebControls.TreeNode.Expanded%2A> property is a tri-state property, the following C# code snippet causes a compile error:
```
protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
{
if (TreeView1.Nodes[0].Expanded)
{
// some work here
}
}
```
While VB.Net implicitly casts the `Boolean` value to a `NullableBoolean`, C# does not. Therefore, it is a best practice to explicitly check the state of the property. For example, the following code examples in Visual Basic and C# explicitly test the value of the <xref:System.Web.UI.WebControls.TreeNode.Expanded%2A> property.
The following Visual Basic code example explicitly tests the value of the <xref:System.Web.UI.WebControls.TreeNode.Expanded%2A> property. This example tests if the <xref:System.Web.UI.WebControls.TreeNode.Expanded%2A> property is set to `True`; therefore `Nothing` and `False` fall through the `If` statement.
```
If TreeView1.Nodes(0).Expanded = True Then 'some work hereEnd IF
```
This C# code example explicitly tests the value of the <xref:System.Web.UI.WebControls.TreeNode.Expanded%2A> property. This example tests if the <xref:System.Web.UI.WebControls.TreeNode.Expanded%2A> property is set to `True`; therefore `Null` and `False` fall through the `If` statement.
```
if( TreeView1.Nodes[0].Expanded == true ) { //some work here}
```
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.TreeNode.Expanded%2A> property to programmatically expand a node. It initializes all nodes with a depth of one to an expanded state. Notice that when the root node is expanded, its child nodes are already expanded. For this example to work correctly, you must copy the sample XML data below to a file named Book.xml.
[!code-aspx-csharp[TreeNodeExpanded#1](~/samples/snippets/csharp/VS_Snippets_WebNet/TreeNodeExpanded/CS/treenodeexpandedcs.aspx#1)]
[!code-aspx-vb[TreeNodeExpanded#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/TreeNodeExpanded/VB/treenodeexpandedvb.aspx#1)]
The following code is sample XML data for the previous example.
```
<Book Title="Book Title">
<Chapter Heading="Chapter 1">
<Section Heading="Section 1">
</Section>
<Section Heading="Section 2">
</Section>
</Chapter>
<Chapter Heading="Chapter 2">
<Section Heading="Section 1">
</Section>
</Chapter>
</Book>
```
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TreeView" />
<altmember cref="P:System.Web.UI.WebControls.TreeView.ExpandDepth" />
<altmember cref="M:System.Web.UI.WebControls.TreeNode.Collapse" />
<altmember cref="M:System.Web.UI.WebControls.TreeNode.CollapseAll" />
<altmember cref="M:System.Web.UI.WebControls.TreeNode.Expand" />
<altmember cref="M:System.Web.UI.WebControls.TreeNode.ExpandAll" />
<altmember cref="M:System.Web.UI.WebControls.TreeView.ExpandAll" />
<altmember cref="M:System.Web.UI.WebControls.TreeView.CollapseAll" />
</Docs>
</Member>
<Member MemberName="ImageToolTip">
<MemberSignature Language="C#" Value="public string ImageToolTip { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string ImageToolTip" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.TreeNode.ImageToolTip" />
<MemberSignature Language="VB.NET" Value="Public Property ImageToolTip As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ ImageToolTip { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.ImageToolTip : string with get, set" Usage="System.Web.UI.WebControls.TreeNode.ImageToolTip" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue("")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.Localizable(true)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the ToolTip text for the image displayed next to a node.</summary>
<value>The ToolTip text for the image displayed next to a node. The default is an empty string (""), which indicates that this property is not set.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When an image is displayed next to a node (when the <xref:System.Web.UI.WebControls.TreeNode.ImageUrl%2A> property is set), use the <xref:System.Web.UI.WebControls.TreeNode.ImageToolTip%2A> property to specify the ToolTip displayed when the user positions the mouse pointer over the image. The text that you specify provides assistive technology devices with a description of the image that can be used to make the control more accessible.
The value of this property is stored in view state.
The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see <xref:System.ComponentModel.LocalizableAttribute> and [Globalization and Localization](https://msdn.microsoft.com/library/8ef3838e-9d05-4236-9dd0-ceecff9df80d).
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.TreeNode.ImageToolTip%2A> property to specify the ToolTip text for an image displayed next to a node. For this example to work correctly, you must provide your own images.
[!code-aspx-csharp[TreeNodeImageToolTip#1](~/samples/snippets/csharp/VS_Snippets_WebNet/TreeNodeImageToolTip/CS/treenodeimagetooltipcs.aspx#1)]
[!code-aspx-vb[TreeNodeImageToolTip#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/TreeNodeImageToolTip/VB/treenodeimagetooltipvb.aspx#1)]
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.WebControls.TreeNode.ImageUrl" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.ToolTip" />
</Docs>
</Member>
<Member MemberName="ImageUrl">
<MemberSignature Language="C#" Value="public string ImageUrl { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string ImageUrl" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.TreeNode.ImageUrl" />
<MemberSignature Language="VB.NET" Value="Public Property ImageUrl As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ ImageUrl { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.ImageUrl : string with get, set" Usage="System.Web.UI.WebControls.TreeNode.ImageUrl" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue("")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
<AttributeName>System.ComponentModel.Editor("System.Web.UI.Design.ImageUrlEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Web.UI.UrlProperty</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5">
<AttributeName>System.ComponentModel.Editor("System.Web.UI.Design.ImageUrlEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the URL to an image that is displayed next to the node.</summary>
<value>The URL to a custom image that is displayed next to the node. The default value is an empty string (""), which indicates that this property is not set.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.TreeNode.ImageUrl%2A> property to specify a custom image for the current node in the <xref:System.Web.UI.WebControls.TreeView> control. This image is displayed next to the node and can be in any file format (.jpg, .gif, .bmp, and so on), as long as the client's browser supports that format.
The value of this property is stored in view state.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.TreeNode.ImageUrl%2A> property to provide a custom image for a node. For this example to work correctly, you must copy the sample XML data below to a file named Book.xml.
[!code-aspx-csharp[TreeViewTreeNodeDataBound#1](~/samples/snippets/csharp/VS_Snippets_WebNet/TreeViewTreeNodeDataBound/CS/treeviewtreenodedataboundcs.aspx#1)]
[!code-aspx-vb[TreeViewTreeNodeDataBound#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/TreeViewTreeNodeDataBound/VB/treeviewtreenodedataboundvb.aspx#1)]
The following code is sample XML data for the previous example.
```
<Book Title="Book Title">
<Chapter Heading="Chapter 1">
<Section Heading="Section 1">
</Section>
<Section Heading="Section 2">
</Section>
</Chapter>
<Chapter Heading="Chapter 2">
<Section Heading="Section 1">
</Section>
</Chapter>
</Book>
```
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TreeView" />
<altmember cref="P:System.Web.UI.WebControls.TreeView.ImageSet" />
</Docs>
</Member>
<Member MemberName="IsTrackingViewState">
<MemberSignature Language="C#" Value="protected bool IsTrackingViewState { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool IsTrackingViewState" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.TreeNode.IsTrackingViewState" />
<MemberSignature Language="VB.NET" Value="Protected ReadOnly Property IsTrackingViewState As Boolean" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; property bool IsTrackingViewState { bool get(); };" />
<MemberSignature Language="F#" Value="member this.IsTrackingViewState : bool" Usage="System.Web.UI.WebControls.TreeNode.IsTrackingViewState" />
<MemberType>Property</MemberType>
<Implements>
<InterfaceMember>P:System.Web.UI.IStateManager.IsTrackingViewState</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a value that indicates whether the node is saving changes to its view state.</summary>
<value>
<see langword="true" /> if the control is marked to save its state; otherwise, <see langword="false" />.</value>
<remarks>To be added.</remarks>
<altmember cref="P:System.Web.UI.IStateManager.IsTrackingViewState" />
<related type="Article" href="https://msdn.microsoft.com/library/19d2a6ed-9a77-4c7c-a7f5-74dd4b6c3818">View State Overview</related>
</Docs>
</Member>
<Member MemberName="LoadViewState">
<MemberSignature Language="C#" Value="protected virtual void LoadViewState (object state);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void LoadViewState(object state) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.TreeNode.LoadViewState(System.Object)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub LoadViewState (state As Object)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void LoadViewState(System::Object ^ state);" />
<MemberSignature Language="F#" Value="abstract member LoadViewState : obj -&gt; unit&#xA;override this.LoadViewState : obj -&gt; unit" Usage="treeNode.LoadViewState state" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.Web.UI.IStateManager.LoadViewState(System.Object)</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="state" Type="System.Object" />
</Parameters>
<Docs>
<param name="state">An <see cref="T:System.Object" /> that represents the state of the node.</param>
<summary>Loads the previously saved view state of the node.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
<xref:System.Web.UI.WebControls.TreeNode.LoadViewState%2A> is a helper method used to load the previously saved view state of the node
]]></format>
</remarks>
<altmember cref="M:System.Web.UI.IStateManager.LoadViewState(System.Object)" />
<related type="Article" href="https://msdn.microsoft.com/library/19d2a6ed-9a77-4c7c-a7f5-74dd4b6c3818">View State Overview</related>
</Docs>
</Member>
<Member MemberName="NavigateUrl">
<MemberSignature Language="C#" Value="public string NavigateUrl { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string NavigateUrl" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.TreeNode.NavigateUrl" />
<MemberSignature Language="VB.NET" Value="Public Property NavigateUrl As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ NavigateUrl { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.NavigateUrl : string with get, set" Usage="System.Web.UI.WebControls.TreeNode.NavigateUrl" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue("")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
<AttributeName>System.ComponentModel.Editor("System.Web.UI.Design.UrlEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Web.UI.UrlProperty</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5">
<AttributeName>System.ComponentModel.Editor("System.Web.UI.Design.UrlEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the URL to navigate to when the node is clicked.</summary>
<value>The URL to navigate to when the node is clicked. The default value is an empty string (""), which indicates that this property is not set.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The text of a node can be in one of two modes: selection mode or navigation mode. By default, a node is in selection mode. To put a node into navigation mode, set the node's <xref:System.Web.UI.WebControls.TreeNode.NavigateUrl%2A> property to a value other than an empty string.
When a node is in navigation mode, all selection events are disabled for that node. Clicking the node in navigation mode links the user to the specified URL. You can optionally set the <xref:System.Web.UI.WebControls.TreeNode.Target%2A> property to specify the window or frame in which to display the linked content.
The value of this property is stored in view state.
## Examples
The following code example demonstrates how to set up the frames for the next code example.
[!code-aspx-csharp[TreeViewFrameSet#1](~/samples/snippets/csharp/VS_Snippets_WebNet/TreeViewFrameSet/CS/framecs.aspx#1)]
[!code-aspx-vb[TreeViewFrameSet#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/TreeViewFrameSet/VB/framevb.aspx#1)]
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.TreeNode.NavigateUrl%2A> property to specify the URL to link to when the node is clicked. This example is used within the frameset of the previous example to display a table of contents.
[!code-aspx-csharp[TreeViewFrameExample#1](~/samples/snippets/csharp/VS_Snippets_WebNet/TreeViewFrameExample/CS/treeviewframecs.aspx#1)]
[!code-aspx-vb[TreeViewFrameExample#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/TreeViewFrameExample/VB/treeviewframevb.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TreeView" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.Target" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.SelectAction" />
</Docs>
</Member>
<Member MemberName="Parent">
<MemberSignature Language="C#" Value="public System.Web.UI.WebControls.TreeNode Parent { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Web.UI.WebControls.TreeNode Parent" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.TreeNode.Parent" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Parent As TreeNode" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Web::UI::WebControls::TreeNode ^ Parent { System::Web::UI::WebControls::TreeNode ^ get(); };" />
<MemberSignature Language="F#" Value="member this.Parent : System.Web.UI.WebControls.TreeNode" Usage="System.Web.UI.WebControls.TreeNode.Parent" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Web.UI.WebControls.TreeNode</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the parent node of the current node.</summary>
<value>A <see cref="T:System.Web.UI.WebControls.TreeNode" /> that represents the parent node of the current node.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.TreeNode.Parent%2A> property returns a <xref:System.Web.UI.WebControls.TreeNode> object that represents the parent node of the current node. It is commonly used to determine the parent node or to access the properties of the parent node.
> [!NOTE]
> A root node does not have a parent node.
To access the child nodes of the current node, use the <xref:System.Web.UI.WebControls.TreeNode.ChildNodes%2A> property.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.TreeNode.Parent%2A> property to access the <xref:System.Web.UI.WebControls.TreeNode.Text%2A> property of the current node's parent node.
[!code-aspx-csharp[TreeNodeParent#1](~/samples/snippets/csharp/VS_Snippets_WebNet/TreeNodeParent/CS/treenodeparentcs.aspx#1)]
[!code-aspx-vb[TreeNodeParent#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/TreeNodeParent/VB/treenodeparentvb.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TreeView" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.ChildNodes" />
</Docs>
</Member>
<Member MemberName="PopulateOnDemand">
<MemberSignature Language="C#" Value="public bool PopulateOnDemand { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool PopulateOnDemand" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.TreeNode.PopulateOnDemand" />
<MemberSignature Language="VB.NET" Value="Public Property PopulateOnDemand As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool PopulateOnDemand { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.PopulateOnDemand : bool with get, set" Usage="System.Web.UI.WebControls.TreeNode.PopulateOnDemand" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value that indicates whether the node is populated dynamically.</summary>
<value>
<see langword="true" /> to populate the node dynamically; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Sometimes, it is not practical to statically predefine the tree structure due to data size or custom content that depends on user input. Because of this, the <xref:System.Web.UI.WebControls.TreeView> control supports dynamic node population. When a node's <xref:System.Web.UI.WebControls.TreeNode.PopulateOnDemand%2A> property is set to `true`, that node is populated at run time through a postback event when the node is expanded. To populate a node dynamically, an event-handling method that populates the node must be defined for the <xref:System.Web.UI.WebControls.TreeView.TreeNodePopulate> event.
Supported browsers can also take advantage of client-side node population. When enabled, this allows the <xref:System.Web.UI.WebControls.TreeView> control to dynamically populate a node on the client when that node is expanded, which prevents the need to post back to the server. For more information on client-side node population, see <xref:System.Web.UI.WebControls.TreeView.PopulateNodesFromClient%2A>.
The value of this property is stored in view state.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.TreeNode.PopulateOnDemand%2A> property to indicate that a node is populated dynamically.
[!code-aspx-csharp[TreeViewPopulateNodesFromClient#1](~/samples/snippets/csharp/VS_Snippets_WebNet/TreeViewPopulateNodesFromClient/CS/treeviewpopulatenodesfromclientcs.aspx#1)]
[!code-aspx-vb[TreeViewPopulateNodesFromClient#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/TreeViewPopulateNodesFromClient/VB/treeviewpopulatenodesfromclientvb.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TreeView" />
<altmember cref="E:System.Web.UI.WebControls.TreeView.TreeNodePopulate" />
<altmember cref="P:System.Web.UI.WebControls.TreeView.PopulateNodesFromClient" />
</Docs>
</Member>
<Member MemberName="RenderPostText">
<MemberSignature Language="C#" Value="protected virtual void RenderPostText (System.Web.UI.HtmlTextWriter writer);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void RenderPostText(class System.Web.UI.HtmlTextWriter writer) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.TreeNode.RenderPostText(System.Web.UI.HtmlTextWriter)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub RenderPostText (writer As HtmlTextWriter)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void RenderPostText(System::Web::UI::HtmlTextWriter ^ writer);" />
<MemberSignature Language="F#" Value="abstract member RenderPostText : System.Web.UI.HtmlTextWriter -&gt; unit&#xA;override this.RenderPostText : System.Web.UI.HtmlTextWriter -&gt; unit" Usage="treeNode.RenderPostText writer" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="writer" Type="System.Web.UI.HtmlTextWriter" />
</Parameters>
<Docs>
<param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> that represents the output stream used to write content to a Web page.</param>
<summary>Allows control developers to add additional rendering to the node.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method can be overridden by control developers to add additional rendering after the node is rendered.
]]></format>
</remarks>
<altmember cref="M:System.Web.UI.WebControls.TreeNode.RenderPreText(System.Web.UI.HtmlTextWriter)" />
</Docs>
</Member>
<Member MemberName="RenderPreText">
<MemberSignature Language="C#" Value="protected virtual void RenderPreText (System.Web.UI.HtmlTextWriter writer);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void RenderPreText(class System.Web.UI.HtmlTextWriter writer) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.TreeNode.RenderPreText(System.Web.UI.HtmlTextWriter)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub RenderPreText (writer As HtmlTextWriter)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void RenderPreText(System::Web::UI::HtmlTextWriter ^ writer);" />
<MemberSignature Language="F#" Value="abstract member RenderPreText : System.Web.UI.HtmlTextWriter -&gt; unit&#xA;override this.RenderPreText : System.Web.UI.HtmlTextWriter -&gt; unit" Usage="treeNode.RenderPreText writer" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="writer" Type="System.Web.UI.HtmlTextWriter" />
</Parameters>
<Docs>
<param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> that represents the output stream used to write content to a Web page.</param>
<summary>Allows control developers to add additional rendering to the node.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method can be overridden by control developers to add additional rendering before the node is rendered.
]]></format>
</remarks>
<altmember cref="M:System.Web.UI.WebControls.TreeNode.RenderPreText(System.Web.UI.HtmlTextWriter)" />
</Docs>
</Member>
<Member MemberName="SaveViewState">
<MemberSignature Language="C#" Value="protected virtual object SaveViewState ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance object SaveViewState() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.TreeNode.SaveViewState" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function SaveViewState () As Object" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual System::Object ^ SaveViewState();" />
<MemberSignature Language="F#" Value="abstract member SaveViewState : unit -&gt; obj&#xA;override this.SaveViewState : unit -&gt; obj" Usage="treeNode.SaveViewState " />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.Web.UI.IStateManager.SaveViewState</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Saves the current view state of the node.</summary>
<returns>An <see cref="T:System.Object" /> that contains the saved state of the node.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.TreeNode.SaveViewState%2A> method is a helper method called by the node to save its state.
]]></format>
</remarks>
<altmember cref="M:System.Web.UI.IStateManager.SaveViewState" />
<related type="Article" href="https://msdn.microsoft.com/library/19d2a6ed-9a77-4c7c-a7f5-74dd4b6c3818">View State Overview</related>
</Docs>
</Member>
<Member MemberName="Select">
<MemberSignature Language="C#" Value="public void Select ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Select() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.TreeNode.Select" />
<MemberSignature Language="VB.NET" Value="Public Sub Select ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Select();" />
<MemberSignature Language="F#" Value="member this.Select : unit -&gt; unit" Usage="treeNode.Select " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Selects the current node in the <see cref="T:System.Web.UI.WebControls.TreeView" /> control.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.TreeNode.Select%2A> method to select the current node in the <xref:System.Web.UI.WebControls.TreeView> control.
**Note** As an alternative, you can also select the current node by setting the <xref:System.Web.UI.WebControls.TreeNode.Selected%2A> property to `true`.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.TreeNode.Select%2A> method to select a node in the <xref:System.Web.UI.WebControls.TreeView> control.
[!code-aspx-csharp[TreeNodeSelected2#1](~/samples/snippets/csharp/VS_Snippets_WebNet/TreeNodeSelected2/CS/treenodeselected2cs.aspx#1)]
[!code-aspx-vb[TreeNodeSelected2#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/TreeNodeSelected2/VB/treenodeselected2vb.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TreeView" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.Selected" />
<altmember cref="P:System.Web.UI.WebControls.TreeView.SelectedNode" />
</Docs>
</Member>
<Member MemberName="SelectAction">
<MemberSignature Language="C#" Value="public System.Web.UI.WebControls.TreeNodeSelectAction SelectAction { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Web.UI.WebControls.TreeNodeSelectAction SelectAction" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.TreeNode.SelectAction" />
<MemberSignature Language="VB.NET" Value="Public Property SelectAction As TreeNodeSelectAction" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Web::UI::WebControls::TreeNodeSelectAction SelectAction { System::Web::UI::WebControls::TreeNodeSelectAction get(); void set(System::Web::UI::WebControls::TreeNodeSelectAction value); };" />
<MemberSignature Language="F#" Value="member this.SelectAction : System.Web.UI.WebControls.TreeNodeSelectAction with get, set" Usage="System.Web.UI.WebControls.TreeNode.SelectAction" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(Mono.Cecil.CustomAttributeArgument)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Web.UI.WebControls.TreeNodeSelectAction</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the event or events to raise when a node is selected.</summary>
<value>One of the <see cref="T:System.Web.UI.WebControls.TreeNodeSelectAction" /> values. The default is <see langword="TreeNodeSelectAction.Select" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The text of a node in the <xref:System.Web.UI.WebControls.TreeView> control can be in one of two modes: selection mode or navigation mode. By default, a node is in selection mode. To put a node into navigation mode, set the node's <xref:System.Web.UI.WebControls.TreeNode.NavigateUrl%2A> property to a value other than an empty string (""). To put a node into selection mode, set the node's <xref:System.Web.UI.WebControls.TreeNode.NavigateUrl%2A> property to an empty string.
> [!NOTE]
> When a node is in navigation mode, selection events are disabled for that node. Clicking a node will direct the user to the specified URL, rather than posting the page back to the server and raising an event.
When a node is in selection mode, use the <xref:System.Web.UI.WebControls.TreeNode.SelectAction%2A> property to specify which event or events are raised when a node is selected. The following table lists the available options.
|Selection action|Description|
|----------------------|-----------------|
|`TreeNodeSelectAction.Expand`|Toggles the node between expanded and collapsed. Raises the <xref:System.Web.UI.WebControls.TreeView.TreeNodeExpanded> event or the <xref:System.Web.UI.WebControls.TreeView.TreeNodeCollapsed> event as appropriate.|
|`TreeNodeSelectAction.None`|Raises no events when a node is selected.|
|`TreeNodeSelectAction.Select`|Raises the <xref:System.Web.UI.WebControls.TreeView.SelectedNodeChanged> event when a node is selected.|
|`TreeNodeSelectAction.SelectExpand`|Raises both the <xref:System.Web.UI.WebControls.TreeView.SelectedNodeChanged> and the <xref:System.Web.UI.WebControls.TreeView.TreeNodeExpanded> events when a node is selected. Nodes are only expanded, never collapsed.|
> [!NOTE]
> The <xref:System.Web.UI.WebControls.TreeView.HoverNodeStyle%2A> property is not rendered for a node with its <xref:System.Web.UI.WebControls.TreeNode.SelectAction%2A> property set to `TreeNodeSelectAction.None`.
The value of this property is stored in view state.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.TreeNode.SelectAction%2A> property to specify which event is raised when a node is clicked.
[!code-aspx-csharp[TreeViewPopulateNodesFromClient#1](~/samples/snippets/csharp/VS_Snippets_WebNet/TreeViewPopulateNodesFromClient/CS/treeviewpopulatenodesfromclientcs.aspx#1)]
[!code-aspx-vb[TreeViewPopulateNodesFromClient#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/TreeViewPopulateNodesFromClient/VB/treeviewpopulatenodesfromclientvb.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TreeView" />
<altmember cref="T:System.Web.UI.WebControls.TreeNodeSelectAction" />
<altmember cref="E:System.Web.UI.WebControls.TreeView.SelectedNodeChanged" />
<altmember cref="E:System.Web.UI.WebControls.TreeView.TreeNodeExpanded" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.NavigateUrl" />
</Docs>
</Member>
<Member MemberName="Selected">
<MemberSignature Language="C#" Value="public bool Selected { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool Selected" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.TreeNode.Selected" />
<MemberSignature Language="VB.NET" Value="Public Property Selected As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool Selected { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.Selected : bool with get, set" Usage="System.Web.UI.WebControls.TreeNode.Selected" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value that indicates whether the node is selected.</summary>
<value>
<see langword="true" /> if the node is selected; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.TreeNode.Selected%2A> property to specify or determine whether the node is selected.
> [!NOTE]
> Although the property can be used to determine whether the node is selected, it is more common to use the <xref:System.Web.UI.WebControls.TreeView.SelectedNode%2A> property.
Only one node can be selected at a time in the <xref:System.Web.UI.WebControls.TreeView> control when using this property.
> [!NOTE]
> As an alternative, you can also select the node by using the <xref:System.Web.UI.WebControls.TreeNode.Select%2A> method.
The value of this property is stored in view state.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.TreeNode.Selected%2A> property to select a node in the <xref:System.Web.UI.WebControls.TreeView> control.
[!code-aspx-csharp[TreeNodeSelected2#1](~/samples/snippets/csharp/VS_Snippets_WebNet/TreeNodeSelected2/CS/treenodeselected2cs.aspx#1)]
[!code-aspx-vb[TreeNodeSelected2#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/TreeNodeSelected2/VB/treenodeselected2vb.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TreeView" />
<altmember cref="M:System.Web.UI.WebControls.TreeNode.Select" />
<altmember cref="P:System.Web.UI.WebControls.TreeView.SelectedNode" />
<altmember cref="P:System.Web.UI.WebControls.TreeView.ShowCheckBoxes" />
</Docs>
</Member>
<Member MemberName="ShowCheckBox">
<MemberSignature Language="C#" Value="public Nullable&lt;bool&gt; ShowCheckBox { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Nullable`1&lt;bool&gt; ShowCheckBox" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.TreeNode.ShowCheckBox" />
<MemberSignature Language="VB.NET" Value="Public Property ShowCheckBox As Nullable(Of Boolean)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property Nullable&lt;bool&gt; ShowCheckBox { Nullable&lt;bool&gt; get(); void set(Nullable&lt;bool&gt; value); };" />
<MemberSignature Language="F#" Value="member this.ShowCheckBox : Nullable&lt;bool&gt; with get, set" Usage="System.Web.UI.WebControls.TreeNode.ShowCheckBox" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(typeof(System.Nullable`1&lt;System.Boolean&gt;), "")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Nullable&lt;System.Boolean&gt;</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value that indicates whether a check box is displayed next to the node.</summary>
<value>
<see langword="true" /> to display the check box; otherwise, <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.TreeView> control allows you to display a check box next to a node's image. Use the <xref:System.Web.UI.WebControls.TreeNode.ShowCheckBox%2A> property to show or hide the check box for the current node.
Although the <xref:System.Web.UI.WebControls.TreeNode.ShowCheckBox%2A> property can be used to display check boxes, it is more common to use the <xref:System.Web.UI.WebControls.TreeView.ShowCheckBoxes%2A?displayProperty=nameWithType> property of the <xref:System.Web.UI.WebControls.TreeView> control. The <xref:System.Web.UI.WebControls.TreeView.ShowCheckBoxes%2A?displayProperty=nameWithType> property, however, affects every node type specified by the property; therefore, the <xref:System.Web.UI.WebControls.TreeNode.ShowCheckBox%2A?displayProperty=nameWithType> property is often used to override that setting for an individual node.
Since the <xref:System.Web.UI.WebControls.TreeView.ShowCheckBoxes%2A?displayProperty=nameWithType> property is a tri-state property, the following C# code snippet causes a compile error:
```
protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
{
if (TreeView1.Nodes[0].Expanded)
{
// some work here
}
}
```
While VB.Net implicitly casts the `Boolean` value to a `NullableBoolean`, C# does not. Therefore, it is a best practice to explicitly check the state of the property. For example, the following code examples in Visual Basic and C# explicitly test the value of the <xref:System.Web.UI.WebControls.TreeNode.Expanded%2A> property.
The following Visual Basic code example explicitly tests the value of the <xref:System.Web.UI.WebControls.TreeNode.Expanded%2A> property. This example tests if the <xref:System.Web.UI.WebControls.TreeNode.Expanded%2A> property is set to `True`; therefore `Nothing` and `False` fall through the `If` statement.
```
If TreeView1.Nodes(0).Expanded = True Then 'some work hereEnd IF
```
This C# code example explicitly tests the value of the <xref:System.Web.UI.WebControls.TreeNode.Expanded%2A> property. This example tests if the <xref:System.Web.UI.WebControls.TreeNode.Expanded%2A> property is set to `True`; therefore `Null` and `False` fall through the `If` statement.
```
if( TreeView1.Nodes[0].Expanded == true ) { //some work here}
```
The value of this property is stored in view state.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.TreeNode.ShowCheckBox%2A> property to programmatically show and hide the check box for a node in the <xref:System.Web.UI.WebControls.TreeView> control. For this example to work correctly, you must copy the sample XML data below to a file named Book.xml.
[!code-aspx-csharp[TreeNodeShowCheckBox#1](~/samples/snippets/csharp/VS_Snippets_WebNet/TreeNodeShowCheckBox/CS/treenodeshowcheckboxcs.aspx#1)]
[!code-aspx-vb[TreeNodeShowCheckBox#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/TreeNodeShowCheckBox/VB/treenodeshowcheckboxvb.aspx#1)]
The following code is sample XML data for the previous example.
```
<Book Title="Book Title">
<Chapter Heading="Chapter 1">
<Section Heading="Section 1">
</Section>
<Section Heading="Section 2">
</Section>
</Chapter>
<Chapter Heading="Chapter 2">
<Section Heading="Section 1">
</Section>
</Chapter>
</Book>
```
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TreeView" />
<altmember cref="P:System.Web.UI.WebControls.TreeView.ShowCheckBoxes" />
</Docs>
</Member>
<Member MemberName="System.ICloneable.Clone">
<MemberSignature Language="C#" Value="object ICloneable.Clone ();" />
<MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance object System.ICloneable.Clone() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.TreeNode.System#ICloneable#Clone" />
<MemberSignature Language="VB.NET" Value="Function Clone () As Object Implements ICloneable.Clone" />
<MemberSignature Language="C++ CLI" Value=" virtual System::Object ^ System.ICloneable.Clone() = ICloneable::Clone;" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.ICloneable.Clone</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Creates a copy of the <see cref="T:System.Web.UI.WebControls.TreeNode" /> object.</summary>
<returns>An <see cref="T:System.Object" /> that represents a copy of the <see cref="T:System.Web.UI.WebControls.TreeNode" /> object.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.TreeNode.System%23ICloneable%23Clone%2A> method is used by the <xref:System.Web.UI.WebControls.TreeNode> class to make a copy of itself.
]]></format>
</remarks>
<altmember cref="M:System.ICloneable.Clone" />
</Docs>
</Member>
<Member MemberName="System.Web.UI.IStateManager.IsTrackingViewState">
<MemberSignature Language="C#" Value="bool System.Web.UI.IStateManager.IsTrackingViewState { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool System.Web.UI.IStateManager.IsTrackingViewState" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.TreeNode.System#Web#UI#IStateManager#IsTrackingViewState" />
<MemberSignature Language="VB.NET" Value=" ReadOnly Property IsTrackingViewState As Boolean Implements IStateManager.IsTrackingViewState" />
<MemberSignature Language="C++ CLI" Value="property bool System::Web::UI::IStateManager::IsTrackingViewState { bool get(); };" />
<MemberSignature Language="F#" Usage="System.Web.UI.IStateManager.IsTrackingViewState" />
<MemberType>Property</MemberType>
<Implements>
<InterfaceMember>P:System.Web.UI.IStateManager.IsTrackingViewState</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>For a description of this member, see <see cref="P:System.Web.UI.IStateManager.IsTrackingViewState" />.</summary>
<value>A value that indicates whether the node is saving changes to its view state.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This member is an explicit interface member implementation. It can be used only when the <xref:System.Web.UI.WebControls.TreeNode> instance is cast to the <xref:System.Web.UI.IStateManager> interface.
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.IStateManager" />
</Docs>
</Member>
<Member MemberName="System.Web.UI.IStateManager.LoadViewState">
<MemberSignature Language="C#" Value="void IStateManager.LoadViewState (object state);" />
<MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void System.Web.UI.IStateManager.LoadViewState(object state) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.TreeNode.System#Web#UI#IStateManager#LoadViewState(System.Object)" />
<MemberSignature Language="VB.NET" Value="Sub LoadViewState (state As Object) Implements IStateManager.LoadViewState" />
<MemberSignature Language="C++ CLI" Value=" virtual void System.Web.UI.IStateManager.LoadViewState(System::Object ^ state) = System::Web::UI::IStateManager::LoadViewState;" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.Web.UI.IStateManager.LoadViewState(System.Object)</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="state" Type="System.Object" />
</Parameters>
<Docs>
<param name="state">A <see cref="T:System.Object" /> that contains the saved view state values.</param>
<summary>Loads the node's previously saved view state.</summary>
<remarks>To be added.</remarks>
<altmember cref="T:System.Web.UI.StateBag" />
<altmember cref="T:System.Web.UI.StateItem" />
<related type="Article" href="https://msdn.microsoft.com/library/0218d965-5d30-445b-b6a6-8870e70e63ce(v=vs.100)">ASP.NET State Management Overview</related>
</Docs>
</Member>
<Member MemberName="System.Web.UI.IStateManager.SaveViewState">
<MemberSignature Language="C#" Value="object IStateManager.SaveViewState ();" />
<MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance object System.Web.UI.IStateManager.SaveViewState() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.TreeNode.System#Web#UI#IStateManager#SaveViewState" />
<MemberSignature Language="VB.NET" Value="Function SaveViewState () As Object Implements IStateManager.SaveViewState" />
<MemberSignature Language="C++ CLI" Value=" virtual System::Object ^ System.Web.UI.IStateManager.SaveViewState() = System::Web::UI::IStateManager::SaveViewState;" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.Web.UI.IStateManager.SaveViewState</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Saves the view state changes to a <see cref="T:System.Object" />.</summary>
<returns>The <see cref="T:System.Object" /> that contains the view state changes.</returns>
<remarks>To be added.</remarks>
<altmember cref="T:System.Web.UI.StateBag" />
<altmember cref="T:System.Web.UI.StateItem" />
<related type="Article" href="https://msdn.microsoft.com/library/0218d965-5d30-445b-b6a6-8870e70e63ce(v=vs.100)">ASP.NET State Management Overview</related>
</Docs>
</Member>
<Member MemberName="System.Web.UI.IStateManager.TrackViewState">
<MemberSignature Language="C#" Value="void IStateManager.TrackViewState ();" />
<MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void System.Web.UI.IStateManager.TrackViewState() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.TreeNode.System#Web#UI#IStateManager#TrackViewState" />
<MemberSignature Language="VB.NET" Value="Sub TrackViewState () Implements IStateManager.TrackViewState" />
<MemberSignature Language="C++ CLI" Value=" virtual void System.Web.UI.IStateManager.TrackViewState() = System::Web::UI::IStateManager::TrackViewState;" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.Web.UI.IStateManager.TrackViewState</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Instructs the <see cref="T:System.Web.UI.WebControls.TreeNode" /> object to track changes to its view state.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
After this method has been called on a server control, the <xref:System.Web.UI.Control.IsTrackingViewState%2A> property returns `true`.
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.StateBag" />
<altmember cref="T:System.Web.UI.StateItem" />
<related type="Article" href="https://msdn.microsoft.com/library/0218d965-5d30-445b-b6a6-8870e70e63ce(v=vs.100)">ASP.NET State Management Overview</related>
</Docs>
</Member>
<Member MemberName="Target">
<MemberSignature Language="C#" Value="public string Target { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string Target" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.TreeNode.Target" />
<MemberSignature Language="VB.NET" Value="Public Property Target As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ Target { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.Target : string with get, set" Usage="System.Web.UI.WebControls.TreeNode.Target" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue("")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the target window or frame in which to display the Web page content associated with a node.</summary>
<value>The target window or frame in which to display the linked Web page content. Values must begin with a letter in the range of A through Z (case-insensitive), except for certain special values that begin with an underscore, as shown in the following table.
<list type="table"><listheader><term> Target value
</term><description> Description
</description></listheader><item><term><see langword="_blank" /></term><description> Renders the content in a new window without frames.
</description></item><item><term><see langword="_parent" /></term><description> Renders the content in the immediate frameset parent.
</description></item><item><term><see langword="_search" /></term><description> Renders the content in the search pane.
</description></item><item><term><see langword="_self" /></term><description> Renders the content in the frame with focus.
</description></item><item><term><see langword="_top" /></term><description> Renders the content in the full window without frames.
</description></item></list><block subset="none" type="note"><para>
Check your browser documentation to determine whether the <see langword="_search" /> value is supported. For example, Microsoft Internet Explorer 5.0 and later support the <see langword="_search" /> target value.
</para></block>
The default value is an empty string (""), which refreshes the window or frame with focus.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.TreeNode.Target%2A> property to specify the window or frame in which to display the Web content linked to a node when that node is clicked.
> [!NOTE]
> Setting this property overrides the <xref:System.Web.UI.WebControls.TreeView.Target%2A> property of the <xref:System.Web.UI.WebControls.TreeView> control.
> [!NOTE]
> The <xref:System.Web.UI.WebControls.TreeNode.Target%2A> property renders as a `target` attribute. The `target` attribute on `anchor` elements is not allowed in the XHTML 1.1 document type definition. Do not set the <xref:System.Web.UI.WebControls.TreeNode.Target%2A> property if the rendered output for the <xref:System.Web.UI.WebControls.TreeNode> object must be XHTML 1.1-compliant. For more information, see [XHTML Standards in Visual Studio and ASP.NET](https://msdn.microsoft.com/library/1b78d416-66bb-43a5-ac77-c703aab55b97).
>
> When creating accessible Web pages, it is strongly recommended you avoid using the <xref:System.Web.UI.WebControls.TreeNode.Target%2A> property to target another window. For more information, see [NIB: ASP.NET Accessibility](https://msdn.microsoft.com/library/9b5f3e05-e88d-4248-a5f4-9e64850fa0ae).
The value of this property is stored in view state.
## Examples
The following code example demonstrates how to set up the frames for the next example.
[!code-aspx-csharp[TreeViewFrameSet#1](~/samples/snippets/csharp/VS_Snippets_WebNet/TreeViewFrameSet/CS/framecs.aspx#1)]
[!code-aspx-vb[TreeViewFrameSet#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/TreeViewFrameSet/VB/framevb.aspx#1)]
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.TreeNode.Target%2A> property to specify the frame in which to display the linked content. This example is used within the frameset of the previous example to display a table of contents.
[!code-aspx-csharp[TreeViewFrameExample#1](~/samples/snippets/csharp/VS_Snippets_WebNet/TreeViewFrameExample/CS/treeviewframecs.aspx#1)]
[!code-aspx-vb[TreeViewFrameExample#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/TreeViewFrameExample/VB/treeviewframevb.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TreeView" />
<altmember cref="P:System.Web.UI.WebControls.TreeView.Target" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.NavigateUrl" />
</Docs>
</Member>
<Member MemberName="Text">
<MemberSignature Language="C#" Value="public string Text { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string Text" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.TreeNode.Text" />
<MemberSignature Language="VB.NET" Value="Public Property Text As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ Text { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.Text : string with get, set" Usage="System.Web.UI.WebControls.TreeNode.Text" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue("")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.Localizable(true)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the text displayed for the node in the <see cref="T:System.Web.UI.WebControls.TreeView" /> control.</summary>
<value>The text displayed for the node in the <see cref="T:System.Web.UI.WebControls.TreeView" /> control. The default is an empty string ("").</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.TreeNode.Text%2A> property to specify or determine the text that is displayed for the node in the <xref:System.Web.UI.WebControls.TreeView> control.
> [!NOTE]
> If the <xref:System.Web.UI.WebControls.TreeNode.Text%2A> property contains `null`, the `get` accessor returns the value of the <xref:System.Web.UI.WebControls.TreeNode.Value%2A> property. If the <xref:System.Web.UI.WebControls.TreeNode.Value%2A> property, in turn, contains `null`, <xref:System.String.Empty> is returned.
The value of this property is stored in view state.
The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see <xref:System.ComponentModel.LocalizableAttribute> and [Globalization and Localization](https://msdn.microsoft.com/library/8ef3838e-9d05-4236-9dd0-ceecff9df80d).
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.TreeNode.Text%2A> property to specify the text for a node.
[!code-aspx-csharp[TreeViewFrameExample#1](~/samples/snippets/csharp/VS_Snippets_WebNet/TreeViewFrameExample/CS/treeviewframecs.aspx#1)]
[!code-aspx-vb[TreeViewFrameExample#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/TreeViewFrameExample/VB/treeviewframevb.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TreeView" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.Value" />
</Docs>
</Member>
<Member MemberName="ToggleExpandState">
<MemberSignature Language="C#" Value="public void ToggleExpandState ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void ToggleExpandState() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.TreeNode.ToggleExpandState" />
<MemberSignature Language="VB.NET" Value="Public Sub ToggleExpandState ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void ToggleExpandState();" />
<MemberSignature Language="F#" Value="member this.ToggleExpandState : unit -&gt; unit" Usage="treeNode.ToggleExpandState " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Alternates between the expanded and collapsed state of the node.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.TreeNode.ToggleExpandState%2A> method to alternate between an expanded and a collapsed state for the node. For example, if the node is collapsed, calling the <xref:System.Web.UI.WebControls.TreeNode.ToggleExpandState%2A> method expands the node, and vice versa.
> [!NOTE]
> As an alternative, you can set the <xref:System.Web.UI.WebControls.TreeNode.Expanded%2A> property directly.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.TreeNode.ToggleExpandState%2A> method to alternate between an expanded and a collapsed state for the root node of a <xref:System.Web.UI.WebControls.TreeView> control.
[!code-aspx-csharp[TreeNodeToggleExpandState#1](~/samples/snippets/csharp/VS_Snippets_WebNet/TreeNodeToggleExpandState/CS/treenodetoggleexpandstatecs.aspx#1)]
[!code-aspx-vb[TreeNodeToggleExpandState#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/TreeNodeToggleExpandState/VB/treenodetoggleexpandstatevb.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TreeView" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.Expanded" />
<altmember cref="M:System.Web.UI.WebControls.TreeNode.Collapse" />
<altmember cref="M:System.Web.UI.WebControls.TreeNode.CollapseAll" />
<altmember cref="M:System.Web.UI.WebControls.TreeNode.Expand" />
<altmember cref="M:System.Web.UI.WebControls.TreeNode.ExpandAll" />
</Docs>
</Member>
<Member MemberName="ToolTip">
<MemberSignature Language="C#" Value="public string ToolTip { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string ToolTip" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.TreeNode.ToolTip" />
<MemberSignature Language="VB.NET" Value="Public Property ToolTip As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ ToolTip { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.ToolTip : string with get, set" Usage="System.Web.UI.WebControls.TreeNode.ToolTip" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue("")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.Localizable(true)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the ToolTip text for the node.</summary>
<value>The ToolTip text for the node. The default is an empty string ("").</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.TreeNode.ToolTip%2A> property to specify the ToolTip text for the node. The ToolTip text is displayed when the mouse pointer is positioned over the node.
The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see <xref:System.ComponentModel.LocalizableAttribute> and [Globalization and Localization](https://msdn.microsoft.com/library/8ef3838e-9d05-4236-9dd0-ceecff9df80d).
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.TreeNode.ToolTip%2A> property to provide ToolTips for the nodes in the <xref:System.Web.UI.WebControls.TreeView> control.
[!code-aspx-csharp[TreeNodeToolTip#1](~/samples/snippets/csharp/VS_Snippets_WebNet/TreeNodeToolTip/CS/treenodetooltipcs.aspx#1)]
[!code-aspx-vb[TreeNodeToolTip#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/TreeNodeToolTip/VB/treenodetooltipvb.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TreeView" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.ImageToolTip" />
</Docs>
</Member>
<Member MemberName="TrackViewState">
<MemberSignature Language="C#" Value="protected void TrackViewState ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig instance void TrackViewState() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.TreeNode.TrackViewState" />
<MemberSignature Language="VB.NET" Value="Protected Sub TrackViewState ()" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; void TrackViewState();" />
<MemberSignature Language="F#" Value="member this.TrackViewState : unit -&gt; unit" Usage="treeNode.TrackViewState " />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.Web.UI.IStateManager.TrackViewState</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Marks the starting point at which to begin tracking and saving view state changes to the node.</summary>
<remarks>To be added.</remarks>
<altmember cref="M:System.Web.UI.IStateManager.TrackViewState" />
<related type="Article" href="https://msdn.microsoft.com/library/19d2a6ed-9a77-4c7c-a7f5-74dd4b6c3818">View State Overview</related>
</Docs>
</Member>
<Member MemberName="Value">
<MemberSignature Language="C#" Value="public string Value { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string Value" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.TreeNode.Value" />
<MemberSignature Language="VB.NET" Value="Public Property Value As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ Value { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.Value : string with get, set" Usage="System.Web.UI.WebControls.TreeNode.Value" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue("")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.Localizable(true)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a non-displayed value used to store any additional data about the node, such as data used for handling postback events.</summary>
<value>Supplemental data about the node that is not displayed. The default value is an empty string ("").</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.TreeNode.Value%2A> property is used to supplement the <xref:System.Web.UI.WebControls.TreeNode.Text%2A> property by storing any additional data associated with the node. This value is not displayed in the control and is commonly used to store data for handling postback events.
> [!NOTE]
> If the <xref:System.Web.UI.WebControls.TreeNode.Value%2A> property contains `null`, the `get` accessor returns the value of the <xref:System.Web.UI.WebControls.TreeNode.Text%2A> property. If the <xref:System.Web.UI.WebControls.TreeNode.Text%2A> property, in turn, contains `null`, <xref:System.String.Empty> is returned.
> [!NOTE]
> Nodes at the same level must each have a unique value for the <xref:System.Web.UI.WebControls.TreeNode.Value%2A> property; the <xref:System.Web.UI.WebControls.TreeView> control cannot distinguish between different nodes at the same level that have the same value. In this scenario, if the user clicks a node that has a duplicate value, the node that appears first in the <xref:System.Web.UI.WebControls.TreeView> control is selected.
The value of this property is stored in view state.
The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see <xref:System.ComponentModel.LocalizableAttribute> and [Globalization and Localization](https://msdn.microsoft.com/library/8ef3838e-9d05-4236-9dd0-ceecff9df80d).
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.TreeNode.Value%2A> property to store the key field.
[!code-aspx-csharp[TreeViewPopulateNodesFromClient#1](~/samples/snippets/csharp/VS_Snippets_WebNet/TreeViewPopulateNodesFromClient/CS/treeviewpopulatenodesfromclientcs.aspx#1)]
[!code-aspx-vb[TreeViewPopulateNodesFromClient#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/TreeViewPopulateNodesFromClient/VB/treeviewpopulatenodesfromclientvb.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TreeView" />
<altmember cref="P:System.Web.UI.WebControls.TreeNode.Text" />
</Docs>
</Member>
<Member MemberName="ValuePath">
<MemberSignature Language="C#" Value="public string ValuePath { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance string ValuePath" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.TreeNode.ValuePath" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property ValuePath As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ ValuePath { System::String ^ get(); };" />
<MemberSignature Language="F#" Value="member this.ValuePath : string" Usage="System.Web.UI.WebControls.TreeNode.ValuePath" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the path from the root node to the current node.</summary>
<value>A delimiter-separated list of node values that form a path from the root node to the current node.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.TreeNode.ValuePath%2A> property contains a delimiter-separated list of node values that form a path from the root node to the current node. Use the <xref:System.Web.UI.WebControls.TreeView.PathSeparator%2A> property to specify the delimiter character used to separate the node values. This value is commonly used when parsing the list for the individual values, or to pass as an argument to the <xref:System.Web.UI.WebControls.TreeView.FindNode%2A> method of the <xref:System.Web.UI.WebControls.TreeView> class.
Depending on the value displayed in the <xref:System.Web.UI.WebControls.TreeView> control, the delimiter character might need to be changed to prevent any conflicts. For example, if you set the delimiter character to a comma, the displayed value should not contain any commas; otherwise, you cannot accurately parse the <xref:System.Web.UI.WebControls.TreeNode.ValuePath%2A> property.
> [!NOTE]
> Nodes at the same level must each have a unique value for the <xref:System.Web.UI.WebControls.TreeNode.Value%2A> property; the <xref:System.Web.UI.WebControls.TreeView> control cannot distinguish between different nodes at the same level that have the same value. In this scenario, if the user clicks a node that has a duplicate value, the node that appears first in the <xref:System.Web.UI.WebControls.TreeView> control is selected.
## Examples
The following code example demonstrates how to parse the <xref:System.Web.UI.WebControls.TreeNode.ValuePath%2A> property.
[!code-aspx-csharp[TreeViewPathSeparator2#1](~/samples/snippets/csharp/VS_Snippets_WebNet/TreeViewPathSeparator2/CS/treeviewpathseparatorcs.aspx#1)]
[!code-aspx-vb[TreeViewPathSeparator2#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/TreeViewPathSeparator2/VB/treeviewpathseparatorvb.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TreeView" />
<altmember cref="P:System.Web.UI.WebControls.TreeView.PathSeparator" />
<altmember cref="M:System.Web.UI.WebControls.TreeView.FindNode(System.String)" />
</Docs>
</Member>
</Members>
</Type>
You can’t perform that action at this time.