I used this code to maintain scroll position and don’t have a clue of what it means. If someone has the time, can you provide me with an step by step explanation of what it is doing. Here it is:
<script language='javascript' type='text/javascript'> var xPos, yPos; var prm = Sys.WebForms.PageRequestManager.getInstance(); function BeginRequestHandler(sender, args) { if ($get('<%=lstAuctions.ClientID %>') != null) { xPos = $get('<%=lstAuctions.ClientID %>').scrollLeft; yPos = $get('<%=lstAuctions.ClientID %>').scrollTop; } } function EndRequestHandler(sender, args) { if ($get('<%=lstAuctions.ClientID %>') != null) { $get('<%=lstAuctions.ClientID %>').scrollLeft = xPos; $get('<%=lstAuctions.ClientID %>').scrollTop = yPos; } } prm.add_beginRequest(BeginRequestHandler); prm.add_endRequest(EndRequestHandler); </script>
1 Answer