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

HomeHomeGetting StartedGetting StartedNew to DNN Plat...New to DNN Plat...Getting page to scroll to top Getting page to scroll to top
Previous
 
Next
New Post
10/7/2011 1:22 PM
 
I'm working on a custom module and at one point during the processing the user clicks a button near the bottom of the screen.  Once the processing on the button is complete I would like to automatically scroll the window back to the top of the screen where information has been updated because of the clicking of the button.  Can someone point me in the right direction as to how I can  scroll back to the top of the window programmatically?   Any help is much appreciated.
 
New Post
10/7/2011 2:39 PM
 
Would the following not achieve this or have I misunderstood ?


Hard codes into the top div or table
<a name="Anchor">Anchor</a>


With a button to go to the anchor
<a href="#Anchor">Go_To_Button</a>


Ian

Mutate and Survive
 
New Post
10/7/2011 2:47 PM
 
That would do it but it requires the user to click on the button. 

Maybe it would help if I gave some more specifics.  On the page there is a datagrid list and the user of the site checks those items in the list that they are interested in and then clicks on a button below the datagrid to add the items to their customized list.  The customized list is shown at the top of the screen.  So... this is what happens. They click on the button below the datagrid to add the items to their list and I add them to the list. That's all working fine but the page stays at the bottom of the datagrid and I'd like to automatically take them back to the top of the screen so they could see the changes in their list.  I don't want them to have to click on anything beside the button that adds the items to their list.

Any ideas?
 
New Post
10/7/2011 6:54 PM
 
I found the answer.  Very simple.

http://www.dotnetnuke.com/Resources/Wiki/Page/How-to-trigger-Position-at-the-top-from-a-NET-program.aspx

The link above provides the code and an explanation.  In short just add the code below in your code-behind as the last thing that is done before returning control to the user.  You don't have to worry about adding a control of your own for 'ScrollTop'.  Just add the code.  It works.

'position at the top 
Dim t As HtmlInputHidden = Page.FindControl("ScrollTop") 
If t IsNot Nothing Then t.Value = 0
 
Previous
 
Next
HomeHomeGetting StartedGetting StartedNew to DNN Plat...New to DNN Plat...Getting page to scroll to top Getting page to scroll to top


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