在网格视图分页期间保持滚动条位置 [英] Maintain scroll bar position during grid view Paging

查看:64
本文介绍了在网格视图分页期间保持滚动条位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的页面上有两个网格视图...并且底部有分页支持..但每当我更改该网格视图的索引发回时,滚动条将自己置于顶部。我试图在更新面板控件中插入该网格视图并使用一些java脚本。但仍然没有用。

解决方案

在页面标签中写下属性

 MaintainScrollPositionOnPostback =true





例如



 <%@     Page    标题  = 主页   语言  =  C#    MasterPageFile   = 〜/ Site.master    AutoEventWireup   =  true  

CodeFile = Default.aspx.cs 继承 = < span class =code-keyword> _默认 MaintainScrollPositionOnPostback = true %GT;


I have two grid views on my page ... and the bottom has got paging support .. but whenever i change the index of that grid view post back occurs and the scroll bar position himself on top. I tried to insert that grid view in an update panel control and use some java script . but still its not working .

解决方案

write below properties in your page tag

MaintainScrollPositionOnPostback="true"



for e.g

<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"

    CodeFile="Default.aspx.cs" Inherits="_Default" MaintainScrollPositionOnPostback="true" %>


这篇关于在网格视图分页期间保持滚动条位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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