Copied to clipboard

Flag this post as spam?

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


  • Ryan 10 posts 30 karma points
    Jan 21, 2011 @ 02:34
    Ryan
    0

    Help! Problem with scroll position

    Hi all,

    I am having a terrible time trying to get a page to maintain scroll position on postback. To explain the situation, I have built a user control as a custom datatype that is used on a tab for a page in the umbraco cms back-end (Umbraco 4.5.2). I have searched high and low and tried every suggestion I have seen on the forums.

    I have put <pages maintainScrollPositionOnPostBack="true"> in web.config.

    I have tried Page.MaintainScrollPositionOnPostBack = true;

    I have also tried custom javascript solutions including the SmartScroller control which I modified to get it to work, and whilst I have solved some javascript errors, it now just fails silently :S

    Does anyone have any ideas? I am really going nuts with this ... surely something so simple is not impossible with umbraco?

  • Rob 43 posts 79 karma points
    Sep 17, 2013 @ 04:34
    Rob
    1

    Just incase this helps anyone else. I just had the same issue.

    Solution. Find the master page (template) you want to have behave that way and add the following somewhere before the first content control.

    <script language="c#" runat="server">
    public void Page_Load(object sender, EventArgs e)
    {
      Page.MaintainScrollPositionOnPostBack = true;
    }
    </script>

    Hope that helps

  • John Halsey 59 posts 220 karma points
    Mar 14, 2014 @ 12:35
    John Halsey
    0

    I'm having this issue too. Rob, is your lats post you say, "add the following" but there is no following code?

    I've created a user control form, inserted it into the page and want it to maintain position on postback. Can't figure it out.

  • Rob 43 posts 79 karma points
    Mar 17, 2014 @ 19:34
    Rob
    1

    <script language="c#" runat="server">
    public void Page_Load(object sender, EventArgs e)
    {
    Page.MaintainScrollPositionOnPostBack = true;
    }
    </script%gt;

    maybe it looked too much like script :) It hides it unless you add the gt lt escaped code..

  • John Halsey 59 posts 220 karma points
    Mar 18, 2014 @ 16:53
    John Halsey
    0

    Wicked, works great.

    Thanks

Please Sign in or register to post replies

Write your reply to:

Draft