Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to fix the position of a scroll bar....after selecting a row in grid view....suppose if i select a last row in a grid view and trying to perform an operation....the selected row should be freezed...it should not go back to the first row in that grid view...similarly how to do in a table contents...instead of gridview..
Posted

1 solution

you have to use in web.config in in your aspx file

the maintainScrollPositionOnPostBack=true

XML
<system.web>
  <pages maintainScrollPositionOnPostBack="true" validateRequest="false /">

usually with that attribute the page mantain the scoll position during postbacks.

if you have problems in that you can look that reference : Maintain Scroll Position in Panel, Div[^]

OR

(a bit tricky) you can save the scroll position on click into a cookie
and at page load (postback) you read the position from the cookie

in my application i have rad ajax manager and
i use that code to save and retrieve scroll position from cookies
the cookies fuction are available here [^]

but my needs are quite differents than your try the solutions above before
 
Share this answer
 
v2
Comments
rake62 24-Jan-12 4:55am    
its not working dude............
rake62 24-Jan-12 6:30am    
I think lot of people might have faced this problem....and overcomed it ..so respond to post....give me a solution..

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