HomeHomeDotNetNuke Forg...DotNetNuke Forg...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
HomeHomeDotNetNuke Forg...DotNetNuke Forg...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIUsing the ScrollTop property?Using the ScrollTop property?


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

Attend A Webinar
Start  Professional Edition Trial
Have Someone Contact Me

Like Us on Facebook Join our Network on LinkedIn Follow DNN Corporate on Twitter Follow DNN on Twitter

Advertisers

Sponsors

DotNetNuke Corporation

DotNetNuke (DNN) provides a suite of solutions that make designing, building and managing feature-rich sites and communities fast, easy and cost-effective. The DotNetNuke Platform CMS is the foundation for more than one million websites worldwide. DNN Social, our newest solution, enables businesses to create immersive, interactive communities. Thousands of organizations like True Value Hardware, Bose, Cornell University, Glacier Water, Dannon, Delphi, USAA, NASCAR, Northern Health and the City of Denver have leveraged DNN to deploy highly engaging business- critical websites. Our rapid growth in product sales and deployments resulted in DotNetNuke Corp. being named one of the fastest growing private companies in America by Inc. Magazine in 2011 and 2012.