System.Web.UI.WebControls Namespace TreeView Class
.NET Framework version 2.0
Sets or retrieves a value indicating whether a TreeView control renders client-side script to handle expanding and collapsing events.
Inline |
<asp:treeview enableclientscript = = true | false ... > |
Script |
TreeView.EnableClientScript [ = true | false ] |
This property accepts or returns only a boolean value: true to render the client-side script on compatible browsers; otherwise, false. Default value is true.
Use the EnableClientScript property to specify whether the 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 TreeNodePopulate event to populate the nodes.
NOTE: If the EnableClientScript property is set to false, the TreeView control posts back to the server each time a node is expanded or collapsed.
TreeView Members