Scroll to top of the page on postback

  •  05-18-2007, 7:13 PM

    Scroll to top of the page on postback

    Hello,
    It seems that Cute Editor control resets page scroll position back to the top after a postback. I'm using "CuteEditor.dll" v6.0.0.0 (CuteEditor 6.0 Build 2007-05-10). I have tracked the issue down to "CuteEditorImplementation.js" (this "js" is accessed from "LoadXMLAsync" function in "Loader.js", if this helps...)
    I have following JScript to control page position after postbacks:
     
     
    <script language='javascript'>      
    function SetScrollLocation() {        
       document.body.scrollTop = ...this value is set in the code-behind during the postback, based on the value of
                                            "__SCROLL_POSITION" element at the time of the postback;    
    }                
    document.body.onload = SetScrollLocation;      
                  
    function SaveScrollLocation() {           
       document.forms[0].__SCROLL_POSITION.value = document.body.scrollTop; 
    }                  
    window.onscroll = SaveScrollLocation;         
    </script>
     
     
    This issue sems to be identical to the problem in the following thread, but no resolution was suggested (http://cutesoft.net/forums/thread/17871.aspx)
     
    Yevgeniy
View Complete Thread