Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mikael Mørup 297 posts 326 karma points
    Sep 10, 2009 @ 13:03
    Mikael Mørup
    0

    MaintainScrollPositionOnPostback

    Is it possible to somehow use MaintainScrollPositionOnPostback="true" in a template ?

    I tried to insert it in the top of the template, but that just results in a yellow screen of death.

    Is it possible

    Mikael

  • dandrayne 1138 posts 2262 karma points
    Sep 10, 2009 @ 15:15
    dandrayne
    0

    You may be able to use

    <pages maintainScrollPositionOnPostBack="true">

    In the web.config (although it will probably affect all pages).

     

    Is this by any chance to maintain scroll position when form validation appears?  There's another option if so

    <script type="text/javascript">
    window.scrollTo = function() { }
    </script>

    disables the scrollto function

     

  • Rick Mather 42 posts 124 karma points
    Sep 10, 2009 @ 18:12
    Rick Mather
    0

    If you only want to do it in pages of a particular template you can do it in Page_Load:

    Page.MaintainScrollPositionOnPostBack = true;

    It's a property of the page not the master page, which is why you're getting a YSOD.

  • Mikael Mørup 297 posts 326 karma points
    Sep 11, 2009 @ 09:01
    Mikael Mørup
    0

    Thanks Rick

    Putting it in page load seems to work.

    Mikael

  • praveen 113 posts 164 karma points
    Jun 30, 2011 @ 06:21
    praveen
    0

    Hi Rick, I am using umbraco 4.0

    I have added Page.MaintainScrollPositionOnPostBack = true; in my usercontrol, but no joy, can someone please help

    Many thanks in advance

    Regards

    Praveen

  • Paul Griffiths 362 posts 1013 karma points
    Mar 26, 2014 @ 11:52
    Paul Griffiths
    0

    Hi praveen

    Did you mange to find a solution to maintain the scroll position on a user control?

    I have a calendar and each time the user changes the date it jumps to the top of the page. Cant seem to find a solution on the web.

    Cheers

    Paul

Please Sign in or register to post replies

Write your reply to:

Draft