ASP.NET MVC3剃刀 - 保持在回发的滚动位置 [英] ASP.NET MVC3 Razor - Maintain scroll position on postback
本文介绍了ASP.NET MVC3剃刀 - 保持在回发的滚动位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何保持排序使用MvcContrib框架网格表后回传的滚动位置?
How can i maintain scroll position on postback after sorting a grid table that uses MvcContrib framework?
推荐答案
的常用方法是使用一些JavaScript来当前滚动位置设置为隐藏字段,然后恢复该位置上的页面加载(通常在一个jQuery ready事件)。
The usual way is to use some javascript to set the current scroll position to a hidden field, then restore that position on page load (usually in a jquery ready event).
然而,这真的只是一个副作用。你应该做一些AJAX命令来更新网格而不是回发,则无需滚动。
However, that's really just a side effect. You should be doing some kind of ajax command to update the grid rather than a postback, then no scrolling required.
这篇关于ASP.NET MVC3剃刀 - 保持在回发的滚动位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文