Click here to Skip to main content
15,905,414 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all i have a panel in which i have given Style="overflow: scroll; height: 200px;".I have put a datalist in it which get autorefresh using updatepanel.but as the datalist rfresh the scrollbar goes up.i want to position the scroll bar at bottom after the datalist refreshes.any idea plz.thanks in advance....!!
Posted

1 solution

Hi
Try this script
XML
<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) {
        xPos = $get('scrollDiv').scrollLeft;
        yPos = $get('scrollDiv').scrollTop;
    }
    function EndRequestHandler(sender, args) {
        $get('scrollDiv').scrollLeft = xPos;
        $get('scrollDiv').scrollTop = yPos;
    }
</script>
 
Share this answer
 
Comments
mylogics 2-Feb-12 6:42am    
hiii my prob is am showing a chat popup using modalpopup in which am showing the panel with Style="overflow: scroll; height: 200px;" and in this panel there is datalist which get autorefresh.on refresh the the acroll bar moves to up i tried this script but the autorefresh get stops on doing this

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