如何为大页面中的特定面板设置MaintainScrollPositionOnPostback属性 [英] How to set the MaintainScrollPositionOnPostback property for a particular panel in a large page

查看:67
本文介绍了如何为大页面中的特定面板设置MaintainScrollPositionOnPostback属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个大页面包含三个面板。在这个面板中,当点击某个按钮时,页面正在加载并转到顶部。在页面指令中使用MaintainScrollPostionOnPostback属性后,它工作正常。



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.

推荐答案

<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').scrollLeft; yPos =


get('scrollDiv')。scrollTop;
}
函数EndRequestHandler(sender,args){
get('scrollDiv').scrollTop; } function EndRequestHandler(sender, args) {


这篇关于如何为大页面中的特定面板设置MaintainScrollPositionOnPostback属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆