Reputation: 29
Learning asp.net and Web Forms. I have a very lengthy gridview with an edit button for each row. Users click edit, it does a postback, then returns with another column now available for edit and the button has changed into an update and delete button. The problem is when you click edit and the postback occurs, it pops you back up to the top of the page. How can I get it to back where the user was viewing, or at least back to where the only editable row is visible (preferably in the middle of the view, not the top)?
Upvotes: 1
Views: 1276
Reputation: 73731
A first step would be to set MaintainScrollPositionOnPostback
to true
and see if it works as you want. You can set it at the page level:
<%@ Page MaintainScrollPositionOnPostback="true" ... %>
or at the application level in Web.config:
<system.web>
<pages maintainScrollPositionOnPostBack="true" ... />
...
</system.web>
Upvotes: 0