This is a migrated thread and some comments may be shown as answers.

set Page scroll Position to the Top

1 Answer 109 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Santosh
Top achievements
Rank 1
Santosh asked on 27 Apr 2012, 01:55 PM
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

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 01 May 2012, 11:35 AM
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.
Tags
Editor
Asked by
Santosh
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or