I often use the following methods:
C #
Step 1
Replace the tag of <body> with the follewing codes:
<%
If (request ["_ scrollpos"]! = NULL &
request ["_ scrollpos"]! = String. empty) {
int Pos = convert. toint32 (request ["_ scrollpos"]);
response. write (" "onscroll = \" javascript: document. forms [0]. _ scrollpos. value = "+
" thebody. scrolltop; \ "" +
"onLoad = \" javascript: thebody. scrolltop = "+ POS +"; \ ">");
}< br> else {
response. write (" "onscroll = \" javascript: document. forms [0]. _ scrollpos. value = "+
" thebody. scrolltop; \ ">");
}< BR >%>
Step 2
Add the follewing codes between <form> and </form>
<Input type = "hidden" name = "_ scrollpos" value = ""/>
VB
Step 1
Replace the tag of <body> with the follewing codes:
<%
if not request ("_ scrollpos") is nothing then
If request ("_ scrollpos") <> string. empty then
dim POS as integer = ctype (Request ("_ scrollpos"), integer)
response. write ("")
end if
else
response. write (" ")
end if
%>
Step 2
Add the follewing codes between <form> and </form>
<Input type = "hidden" name = "_ scrollpos" value = ""/>