Click here to Skip to main content
15,743,934 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I have added Panel control to a web page which contains a GridView. The
Panel's ScrollBars property is set to vertical. when I click on Edit Item template for a row (which obviously causes a postback), the scroll
position resets to the top which means I can’t see the edit field.
How can I persist the scroll position after clicking on EditItemTemplate (i.e.Edit image). please help

You should write this in the page declaration MaintainScrollPositionOnPostback="true"

So for example:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" MaintainScrollPositionOnPostback="true"%>
Share this answer
krishnaMurali 28-Apr-11 8:38am    
thanks for fast reply
i tried but cant get
See this[^] code project article. I think it is useful.

BTW I gave 5 for you question. When I saw at first, I thought it will done using Ajax update panel. But it isn't.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900