在回发页面上保留页面位置 [英] Preserve page location on PostBack

查看:70
本文介绍了在回发页面上保留页面位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过CP和Google进行了搜索,没有发现任何有用的信息,但也许有人有一些想法.

情况:具有三个数据输入表单的网页;输入形式之间有GridView和文本块,因此页面较长.用户以中间或底部形式输入数据,然后单击提交",发生回发,添加或更新数据,并重新加载页面.

我想保留页面位置,以便在重新加载页面时,用户正在查看从其开始的中间或底部表单,而不是页面的顶部.我已经在页面中添加了MaintainScrollPositionOnPostback指令,但是当前服务器(Windows 2000)显然不支持该指令.
有什么建议吗?

I searched through CP and Google and didn''t find anything useful, but maybe someone has some ideas.

The situation: A web page with three data input forms; there are GridViews and blocks of text in between the input forms, making for a rather long page. The user inputs data in the middle or bottom form and clicks "Submit", a post back occurs, the data is added or updated, and the page reloads.

I want to preserve the page location, so that when the page reloads, the user is looking at the middle or bottom form they started from, and not at the very top of the page. I have added the MaintainScrollPositionOnPostback directive to the page, but it is apparently not supported by our current server (Windows 2000.)

Any suggestions?

推荐答案

如果您的页面很大,我会考虑使用AJAX添加数据,甚至不进行回发.至少使用UpdatePanel.
If you have such a large page I would consider using AJAX to add the data and not even do a postback. At the very least use an UpdatePanel.


这篇关于在回发页面上保留页面位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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