I found a pure JS version and made some modifications to improve it. To download it, I only need to add a line in the page_load event in codebind.CodeSo that JS can be referenced. The Code is as follows:
Page_load
Page. registerstartupscript ("scroll", "<script language = JavaScript> Init () </SCRIPT> ");
JS script
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. Body)
{
Addbehavior ("# default # userdata ");
Load ("scrollstate" + getfilename ());
Scrollleft = getattribute ("scrollleft ");
Scrolltop = getattribute ("scrolltop ");
}
}
Function fnunload ()
{
With(registry.doc ument. Body)
{
Setattribute ("scrollleft", scrollleft );
Setattribute ("scrolltop", scrolltop );
Save ("scrollstate" + getfilename ());
}
}
Window. onload = fnload;
Window. onUnload = fnunload;
function Init ()
{< br> with(window.doc ument. body)
{< br> addbehavior ("# default # userdata");
load ("scrollstate" + getfilename ();
scrollleft = 0;
scrolltop = 0;
setattribute ("scrollleft", 0);
setattribute ("scrolltop", 0 );
Save ("scrollstate" + getfilename ();
}< BR >}