Click here to Skip to main content
15,893,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have large page contains three panels.In this panel one when clicking on some button the page is loading and goes to top.After using MaintainScrollPostionOnPostback property in page directive it works fine.

VB
<%@ Page Language="C#" AutoEventWireup="true" Codebehind="WizardNewProposal.aspx.cs"
    Inherits="Frond.EditPages.WizardNewProposal" MaintainScrollPositionOnPostback="true"%>


But one issue on that.

When I am clicking previous button in panel one to go to panel zero,then the panel zero display at the half of the page at the time of loading.After scrolling and I go to top of the page.Then pressing next button in panel one the same issue occur in panel two.Please give the idea to solve.
Posted
Updated 8-Jan-13 3:11am
v3

1 solution

XML
<script type="text/javascript">
    var xPos, yPos;
    var prm = Sys.WebForms.PageRequestManager.getInstance();
    prm.add_beginRequest(BeginRequestHandler);
    prm.add_endRequest(EndRequestHandler);
    function BeginRequestHandler(sender, args) {
        xPos = $get('scrollDiv').scrollLeft;
        yPos = $get('scrollDiv').scrollTop;
    }
    function EndRequestHandler(sender, args) {
        $get('scrollDiv').scrollLeft = xPos;
        $get('scrollDiv').scrollTop = yPos;
    }
</script>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900