Click here to Skip to main content
12,627,681 members (33,971 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: ASP.NET
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.

<%@ 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 8-Jan-13 3:57am
Updated 8-Jan-13 4:11am
v3

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

<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>
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.161205.3 | Last Updated 8 Jan 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100