<script type="text/javascript">
// It is important to place this JavaScript code after
ScriptManager1
var xPos, yPos; // Set X and Y positions
var prm =
Sys.WebForms.PageRequestManager.getInstance();
function BeginRequestHandler(sender, args) {
if ($get('<%=pnl_memgrid.ClientID%>') != null) {
// Get X and Y positions of scrollbar
before the partial postback
xPos = $get('<%=pnl_memgrid.ClientID%>').scrollLeft;
yPos = $get('<%=pnl_memgrid.ClientID%>').scrollTop;
}
}
function EndRequestHandler(sender, args) {
if ($get('<%=pnl_memgrid.ClientID%>') != null) {
// Set X and Y positions back to the
scrollbar
// after partial postback or full post back
$get('<%=pnl_memgrid.ClientID%>').scrollLeft = xPos;
$get('<%=pnl_memgrid.ClientID%>').scrollTop = yPos;
}
}
prm.add_beginRequest(BeginRequestHandler);
prm.add_endRequest(EndRequestHandler);
</script>
No comments:
Post a Comment