I have two webpages written in asp.net, vb.net is code behind. When I click on next button in one page the second page should appear. The second page is huge one, when I click on the next button, the page is coming, but its focus is bottom, in order to go top, I need to use the scrolling, what I want is to make the focus top.
Share
You can use this script so that your page will be scrolled to a specific control on your page.
The code should be put in your CodeBehind.
Just choose some control which is at the top of your page and it should do the work..
I should note that having your page scroll to the bottom is an unusual behavior and shouldn’t be happening by default. You should probably check why it’s happening in the first place.
Update:
Updated the code since the method used there is obsolete…
Usage:
Equivalent VB.Net: (Thanks to @Mahyar)