Treeview
Problem Description: Frameset in the TreeView, inside the four nodes, want to open one, close the other three nodes.
Start is written in Treeview1_expand, can also be used, you can set AutoPostBack to true, refreshing when it is difficult to look at the Internet to find information
Related topics are as follows:
==================
1. "Do not submit when expanding, change the selection node before submitting"
2. "The TreeView expands a node to automatically retract all other expanded nodes, meaning that there is only one expansion node at a time."
3. "The TreeView unfolds without blinking solution"
4. "The TreeView Symposium"
5. "TreeView JavaScript control Method Research"
==================
There is a JavaScript corner on the top of the writing is good, but try for a long time always error.
So I wrote one for myself.
<script language= "JavaScript" >
function inittree ()
{
var tree = document.all["TreeView1"];
tree.attachevent ("Onexpand", selectedindexchange);//Append Events
}
function Selectedindexchange ()
{
var temp = this. Treeview1.clickednodeindex;
var nodes = new Array ();
nodes = this. Treeview1.getchildren ();
for (i=0;i<nodes.length;i++)
{
if (i!=temp)
{
if (i<10)
Nodeindex = "0" +i;//I have only used four nodes, more than 10 of the self try it.
this. Treeview1.gettreenode (Nodeindex). setattribute (' expanded ', ' false ');
}
}
}
</script>
finally write a
<body
in the body to use.
It is also possible to write JavaScript in Page_Load, as in the "TreeView Symposium", but that would be cumbersome and prone to error.