Link to home
Start Free TrialLog in
Avatar of accmats
accmats

asked on

When page loads, How can I go to the bottom of the page?

Every time I do a postback my page goes back to the top of the page.  My users have to keep scrolling down.  I have turned on Smart Navagation on my page but that has no effect.  Not sure why either.  My form pulls in alot of user controls.  On each post back it adds another user control to the bottom of the web form.  Thats the control I would want to have focus for lack of a better name.

Anyone got a suggestion on either how to set focus to a paticular User Control or how to make the page go to the bottom when it loads?

Thanks for your time!!!
Avatar of onura
onura

Hi,

Put an anchor to the bottom of your page,
<a name="bottom">
and call your page with #bottom at the end.
During the postbacks it should go to bottom anchor.

This might work.
Avatar of accmats

ASKER

what would be the syntax of that #Bottom and would I put that in the page load event?
no, just put after the adress on the link like http://www.nowhere.com/page.aspx#start1
Avatar of YZlat
just use this javascript function:

function scrollToCoordinates() {
      window.scrollTo(0,800)
      
}

call it from body onLoad :

<body onload="javascript:scrollToCoordinates()" MS_POSITIONING="FlowLayout">
nooo, don't use anchors!  You get the double-click effect when the page loads.  Use Javascript and the ScrollIntoView() function.

http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods/scrollintoview.asp
ASKER CERTIFIED SOLUTION
Avatar of YZlat
YZlat
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial