Resolution | page easy to resolve page after return page scrolling to the top
Page after the page to scroll to the top, causing the problem is the page return, is actually equal to load a page, the new loaded page will be fixed-point to the top of the page. This feature will cause very poor user experience, how to solve this problem, we can use the hidden viewstate mechanism to save the current page scrolling position, after the page return call.
<%@ Page language= "C #" codebehind= "Test_THIN.aspx.cs" autoeventwireup= "false" inherits= "EIM.web.Test_THIN"%>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 transitional//en" >
<HTML>
<HEAD>
<title>Test_THIN</title>
<meta name= "generator" content= "Microsoft Visual Studio 7.0" >
<meta name= "Code_language" content= "C #" >
<meta name= "vs_defaultClientScript" content= "JavaScript" >
<meta name= "vs_targetschema" content= "http://schemas.microsoft.com/intellisense/ie5" >
<script language= "JavaScript" >
function Savescroll ()
{
var hid = document.getElementById ("hid");
Hid.value = Document.body.scrollTop;
}
function Getscroll ()
{
var hid = document.getElementById ("hid");
Hid.value = Document.body.scrollTop;
Document.body.scrollTop = Hid.value;
}
</script>
</HEAD>
<body ms_positioning= "GridLayout" onload= "Getscroll ()" Onscroll= "Savescroll ()" >
<form id= "Test_thin" method= "POST" runat= "server" onsubmit= "Savescroll ()" >
<input style= "Z-INDEX:101; left:216px; Position:absolute; Top:127px "type=" hidden "id=" hid "runat=" Server ">
<asp:button id= "Button1" style= "z-index:102; left:37px; Position:absolute; TOP:1529PX "runat=" Server "text=" button "></asp:Button>
</form>
</body>
</HTML>