Problem description: The Treeview in frameset contains four nodes. If you want to open one, close the other three nodes.
It is written in treeview1_expand at the beginning. It can also be used. You can set autopostback to true. It is difficult to refresh, so you can find information on the Internet.
Related topics are as follows:
============================
1. "Do not submit when expanding, submit only when you change the node selection"
2. "enable the Treeview to expand a node and automatically scale back all other expanded nodes, that is, there is only one expanded node at a time"
3. "Treeview unblinking solution"
4. "Treeview topic discussion"
5. "Treeview JavaScript Control Method Research"
============================
There is a javascript corner on it, which is well written. But after trying for a long time, it is always wrong.
So I wrote one 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 only use four nodes, and try more than ten nodes.
This. treeview1.gettreenode (nodeindex). setattribute ('extended', 'false ');
}
}
}
</SCRIPT>
Finally, write
<Body onload = "inittree ();">
You can use it.
Of course, JavaScript can also be written in page_load like in the "Treeview topic discussion", but it is very troublesome,
It is easy to make mistakes.