<Div id = "treediv" style = "width: 226px; Height: 460px; overflow: auto;">
<Asp: Treeview id = "ctrltree" runat = "server" showlines = "true" width = "90%" expanddepth = "0"
Enableclientscript = "false" populatenodesfromclient = "false" ontreenodepopulate = "ctrltree_treenodepopulate">
<Selectednodestyle cssclass = "treeselect" font-bold = "true"/>
<Nodestyle imageurl = "~ /Images/treetop/cert.gif "/>
</ASP: Treeview>
</Div>
<Script language = "JavaScript">
VaR sfirstenter = 1;
// Get the current file name
Function getfilename ()
{
VaR url = This. Location. href;
VaR Pos = URL. lastindexof ("/");
If (Pos =-1)
Pos = URL. lastindexof ("//");
VaR filename = URL. substr (Pos + 1 );
Return filename;
}
Function fnload ()
{
With(registry.doc ument. All. treediv)
{
Try
{
Addbehavior ("# default # userdata"); // enables the body element to support userdate
Load ("scrollstate" + getfilename (); // obtain the status that was previously stored in userdate
// Alert (getattribute ("scrollleft "));
// If (sfirstenter = "0 ")
//{
Scrollleft = getattribute ("scrollleft"); // The left position of the scroll bar
Scrolltop = getattribute ("scrolltop ");
//}
}
Catch (E)
{
// Alert (E );
};
}
}
Function fnunload ()
{
With(registry.doc ument. All. treediv)
{
Try
{
Setattribute ("scrollleft", scrollleft );
Setattribute ("scrolltop", scrolltop );
Save ("scrollstate" + getfilename ());
}
Catch (E)
{
// Alert (E );
};
}
}
Window. onload = fnload;
Window. onUnload = fnunload;
</SCRIPT>