set Page scroll Position to the Top

2 posts, 0 answers
  1. Santosh
    Santosh  avatar
    12 posts
    Member since:
    May 2011

    Posted 27 Apr 2012 Link to this post

    Hello

    In my my application I have created Training .aspx page in that page i have used usercontrol Mydocument.ascx in that  user control i have used  telerik RadEditor Control  but i want my page scroll position set to Top I have written following  javascript code on Training.aspx page and also Mydocument.ascx page  but when I browse This page in IE-8 Page scroll position is set to the Cursor Position of Rad Editor  but I want to show my page from Top I want my page scroll position should be top so I have used Following Javascript Code it works fine in Other browser but in IE-8  after page load scroll position is  set according to cursor position of radEditor

    <script type="text/jscript">
        var xPos, yPos;
        var prm = Sys.WebForms.PageRequestManager.getInstance();
        prm.add_beginRequest(BeginRequestHandler);
        prm.add_endRequest(EndRequestHandler);
        function BeginRequestHandler(sender, args) {

            xPos = $('#<%=reContent.ClientID %>').scrollLeft;
            yPos = $('#<%=reContent.ClientID %>').scrollTop;
        }
        function EndRequestHandler(sender, args) {
            $('#<%=reContent.ClientID %>').scrollLeft = xPos;
            $('#<%=reContent.ClientID %>').scrollTop = yPos;
        }
    </script>

    please reply as soon as possible
  2. Rumen
    Admin
    Rumen avatar
    14389 posts

    Posted 01 May 2012 Link to this post

    Hi,

    My suggestion is to attach to OnClientLoad client event of RadEditor and once it is loaded to scroll the page to the top. If needed execute the code with a small delay (setTimeout function) after the RadEditor's loading on the page.

    You can find more information in the following forum thread on the subject: Editor takes focus.

    Greetings,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top