Page Scrolling After Refresh

  • Thread starter Thread starter Olivier
  • Start date Start date
O

Olivier

Hi,

I'm developping a very long web form.
When the user clicks some combos at the bottom of the form, the page is refreshed.
After the refresh, Is there a way to scroll the page down to the position that was clicked ? Maybe some JS ?

Thanks,

Olivier.
 
Olivier said:
Hi,

I'm developping a very long web form.
When the user clicks some combos at the bottom of the form, the page is refreshed.
After the refresh, Is there a way to scroll the page down to the position
that was clicked ? Maybe some JS ?

Set SmartNavigation=True in the Page directive.

It only works in IE though :-(
 
IE is enough for me, many thanks !

Olivier.

Jos said:
that was clicked ? Maybe some JS ?

Set SmartNavigation=True in the Page directive.

It only works in IE though :-(
 
If you get to a point were SmartNavigation starts creating other problems, another solution is to create a javascript like the following.

function scrolltoctl(strID) {
try
{document.getElementById(strID).scrollIntoView();}
catch(e){}
}

Next create a hidden input on your form and give the body of your page an ID or body1 and a runat="server". Any time you have a postback set the value of the hidden input to the Id, and body1.attributes("onload") = "scrolltoctl('" & strID & "')" where strId is the value of the ID you want the page to return. This method isn't perfect but you can probably fool with it a bit to get the results you want.


Hi,

I'm developping a very long web form.
When the user clicks some combos at the bottom of the form, the page is refreshed.
After the refresh, Is there a way to scroll the page down to the position that was clicked ? Maybe some JS ?

Thanks,

Olivier.
 
Back
Top