I have a master page with an update panel wrapping up the content template. In one of my pages I have a grid view that is residing in a Div that utilizes the overflow method to produce scroll bars. I need to be able to retain the scroll position through post back. I have tried about a dozen 'solutions' to this (all JS) and none of them seem to work in conjunction with the master page. Please help! ><

I think by just posting here it makes the answer 10x easier to find.

As with most of these solutions after your script manager add :

                 <script type="text/javascript">
                     var xPos, yPos;
                     var prm = Sys.WebForms.PageRequestManager.getInstance();
                     prm.add_beginRequest(BeginRequestHandler);
                     prm.add_endRequest(EndRequestHandler);
                     function BeginRequestHandler(sender, args) {
                         try {
                             yPos = $get('ctl00_MainContent_scroll').scrollTop;
                         }
                         catch (err) { }
                     }
                     function EndRequestHandler(sender, args) {
                         try {
                             $get('ctl00_MainContent_scroll').scrollTop = yPos;
                         }
                         catch (err) { } 
                     }
                    </script>

Check your source for your div id...mine was 'scroll' in code but as you see during runtime master page changes that a bit....hope this helps anyone else having issues.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.