Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIUsing the ScrollTop property?Using the ScrollTop property?
Previous
 
Next
New Post
5/24/2006 9:27 PM
 

We made some minor changes to Default.aspx and dnncore.js that seem to improve the cross browser support for preserving scroll position when not in Quirks mode.

In default.aspx:

    REMOVED: 
        <body onscroll="__dnn_bodyscroll()">

In dnncore.js:

    CHANGED (in __dnn_bodyscroll):
        function __dnn_bodyscroll() { ...
    to
        window.onscroll = function __dnn_bodyscroll() { ...

    CHANGED (in __dnn_bodyscroll):
        oF.ScrollTop.value=dnn.dom.getByTagName("body")[0].scrollTop;
    to
        oF.ScrollTop.value=document.documentElement.scrollTop ? 
        document.documentElement.scrollTop : 
        dnn.dom.getByTagName("body")[0].scrollTop;

    CHANGED (in __dnn_setScrollTop):
        dnn.dom.getByTagName("body")[0].scrollTop = iTop;
    to
        window.scrollTo(0, iTop);

 


WildVoice.com Michael Levy - Are you ready to be heard? WildVoice.com
 
New Post
4/26/2007 2:10 PM
 

For me, the module is maintaining scroll position when it shouldn't be. I have a fairly long form with validators near the top. Ideally, if one of the validators fails, it should get the focus... but with the way it's implemented, it keeps scrolling back to the bottom of the form and users might miss the errors. So, how do I go about overriding this?

I've tried adding these to page_load and while the page is extra jumpy now, it still ends up at the bottom.

            cmdSubmit.Attributes.Add("onclick", "__dnn_setScrollTop('0');")
            Me.Attributes.Add("onload", "__dnn_setScrollTop('0');")


David O'Leary
Efficion Consulting
 
New Post
12/14/2007 2:54 PM
 

I guess I hadn't came accross this before, probably just never made a "tall" module until now.

Here is how I fixed it, somewhat of a sledgehammer technique.  Just add the following lines to the page load of whatever module you need to scroll to the top:

HtmlInputHidden hdnTop = (HtmlInputHidden)this.Page.FindControl("ScrollTop");
hdnTop.Value = "0";

Worked for me.

Edit:  Note, this is c# not vb.net.

 
New Post
4/30/2009 1:38 AM
 

I have a custom module that has a multview control on it, when users click forward and back buttons on a view they go the corresponding view but their scroll position is maintained which is not what I want.  I want them to be taken to the top of the new page. 

I have found a way to stop this by doing something similar to my Default.aspx.vb code.  I set the Scrolltop.Value to 0. 

However if I was wondering if there is a better way of doing this.  Maybe I can set something in my module code?

 
New Post
5/1/2009 9:00 AM
 

This is how it should work.  Not sure what version of DNN it got moved into the library project.


 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIUsing the ScrollTop property?Using the ScrollTop property?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out