System.Web.UI.WebControls.TreeView.EnableClientScript Property

Gets or sets a value indicating whether the System.Web.UI.WebControls.TreeView control renders client-side script to handle expanding and collapsing events.

Syntax

[System.ComponentModel.DefaultValue(true)]
[System.Web.UI.Themeable(false)]
public bool EnableClientScript { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

Use the TreeView.EnableClientScript property to specify whether the System.Web.UI.WebControls.TreeView control renders client-side script on compatible browsers to handle expanding and collapsing events. When this property is set to true, compatible browsers execute the code to expand and collapse nodes on the client. The tree node data must be known in advance for the client-side script to work. Using client script prevents a post back to the server each time a node is expanded or collapsed.

When the tree node data is not known in advance, nodes can be populated from the client, if the PopulateNodesFromClient property is also set to true. In this scenario, you must also provide an event-handling method for the TreeView.TreeNodePopulate event to populate the nodes. For more information on client-side node population, see TreeView.PopulateNodesFromClient.

Note:

If the TreeView.EnableClientScript property is set to false, the System.Web.UI.WebControls.TreeView control posts back to the server each time a node is expanded or collapsed.

The value of this property is stored in view state.

This property cannot be set by themes or style sheet themes. For more information, see System.Web.UI.ThemeableAttribute and ASP.NET Themes Overview.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0