简体   繁体   中英

Returning the gridview to its original vertical location after the rowediting postback

Using a combination of asp.net, jQuery, and c# and stored procedures.

I have successfully created a gridview, which I then apply jQuery datatables plugin to provide text column filtering (I disabled most of the other datatables function/settings off)).

The Gridview works as expected and when I make use of the RowEditing and RowUpdating events also, IE the editable fields update nicely.

If the user clicks and edits, then clicks the update link, the database is updated and the page reloads. now if that person has scrolled down say record 50 (half way down for instance) in order to locate and then edit that record, then after the page refresh, the user then has to scroll back down to find that same record.

I'm trying to find a way of returning the user to the same location (record) that they had just edited before the page refresh after the page refresh.

Unless I've misunderstood; your dilemma is nothing to do with gridviews etc, and is all to do with merely maintaining page scroll position on post-back... have a read of this JavaScript solution from the 4 guys

PS Google is your friend

我找到了一个非常简单的解决方案,无需编写大量代码,结果发现它是MaintenanceScrollPositionOnPostback =“ True”页面指令。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM