Subscribe For Free Updates!

We'll not spam mate! We promise.

Wednesday 29 May 2013

Maintain Scroll Position On Postback

Recently i faced problem to maintain scroll position in my page which having A grid with some radio button and check box with autopostback within a Updatepanel.
The main problem is when a postback occur the page is moving to top. i tried a lot and finally got the solution .
1.if you are using IE then its very simple just put the code in your page directive.
but it will not work in Firefox for that you have to add one browser file into your website
Right click on solution explorer > Add New Item
Select Browser File and add it to App_Browsers folder.
Add MaintainScrollPositionOnPostback capability to this browser file as written below.
Some times this also not work,
Then a simple solution just add a blank Update panel after the grid and onpostback just put the focus to that update panel
it will work in any browser.
in cs postbackevent
if any problem just feel free to ask or any modification reply.

Socializer Widget By Blogger Yard
SOCIALIZE IT →
FOLLOW US →
SHARE IT →

0 comments:

Post a Comment