Products

Solutions

Resources

Partners

Community

About

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!

Position at the top from a .NET program

Return to previous page

  • 4/7/2015
  • 1551 Views

Comments

1551 Views

Position at the top from a .NET program

Last updated long time ago

Comments

Common

(Enter the content of this article below)

Advanced

 
Jumping to the top when asp.net gives a postback is not that easy. (ASP 2.0)

Case: you need to press a save button in a very long list, and need to show an error message (which is at the top of the page).

The location of your page is maintained after a postback. So the user never sees the error message *Bummer*

DotNetNuke has a handy solution implemented.

You can use the DNN solution in this way:

'position at the top 

Dim t As HtmlInputHidden = Page.FindControl("ScrollTop")
If t IsNot Nothing Then t.Value = 0


So how does this work?

The DNN framework adds this to the end of the pages:

<input name="ScrollTop" type="hidden" id="ScrollTop" value="0" /> <input name="__dnnVariable" type="hidden" id="__dnnVariable" value="__dnn_pageload__dnn_setScrollTop();" />


So by changing the value of the hidden field ScrollTop, you can position wherever you want.

Copyright © 2025 by ESW Operations, LLC Legal | Privacy
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out