在asp.net页面的网格视图中选择一行后,如何固定滚动条的位置... [英] How to fix the position of a scroll bar....after selecting a row in grid view in an asp.net page

查看:67
本文介绍了在asp.net页面的网格视图中选择一行后,如何固定滚动条的位置...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何固定滚动条的位置....在网格视图中选择一行后....假设我是否在网格视图中选择了最后一行并尝试执行操作....应冻结行...不应返回该网格视图中的第一行...类似地在表内容中执行操作...而不是使用gridview..

how to fix the position of a scroll bar....after selecting a row in grid view....suppose if i select a last row in a grid view and trying to perform an operation....the selected row should be freezed...it should not go back to the first row in that grid view...similarly how to do in a table contents...instead of gridview..

推荐答案

您必须在web.config中的aspx文件中使用

maintenanceScrollPositionOnPostBack = true

you have to use in web.config in in your aspx file

the maintainScrollPositionOnPostBack=true

<system.web>
  <pages maintainScrollPositionOnPostBack="true" validateRequest="false /">


通常具有该属性的页面在回发期间将保留scoll位置.

如果您有问题,可以参考以下内容:在面板中保持滚动位置, Div [ ^ ]



(有点棘手),您可以将点击时的滚动位置保存到Cookie中
并在页面加载(回发)时从cookie中读取位置

在我的应用程序中,我有rad ajax经理和
我使用该代码来保存和检索Cookie中的滚动位置
您可以在此处 [


usually with that attribute the page mantain the scoll position during postbacks.

if you have problems in that you can look that reference : Maintain Scroll Position in Panel, Div[^]

OR

(a bit tricky) you can save the scroll position on click into a cookie
and at page load (postback) you read the position from the cookie

in my application i have rad ajax manager and
i use that code to save and retrieve scroll position from cookies
the cookies fuction are available here [^]

but my needs are quite differents than your try the solutions above before


这篇关于在asp.net页面的网格视图中选择一行后,如何固定滚动条的位置...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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