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!!!
accmatsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

onuraCommented:
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.
0
accmatsAuthor Commented:
what would be the syntax of that #Bottom and would I put that in the page load event?
0
onuraCommented:
no, just put after the adress on the link like http://www.nowhere.com/page.aspx#start1
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

YZlatCommented:
just use this javascript function:

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

call it from body onLoad :

<body onload="javascript:scrollToCoordinates()" MS_POSITIONING="FlowLayout">
0
raterusCommented:
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
0
YZlatCommented:
add two hidden fields to the page, call then scrollx and scrolly. Then add the following javascript code:

var IE = document.all?true:false;
if (!IE) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;

var tempX = 0;
var tempY = 0;
function getMouseXY(e) {
if (IE) { // grab the x-y pos.s if browser is IE
tempX = event.clientX + document.body.scrollLeft;
tempY = event.clientY + document.body.scrollTop;
}
else {  // grab the x-y pos.s if browser is NS
tempX = e.pageX;
tempY = e.pageY;
}  
if (tempX < 0){tempX = 0;}
if (tempY < 0){tempY = 0;}  
document.Form1.scrollx.value = tempX;
document.Form1.scrolly.value = tempY;

return true;
}
function scrollToCoordinates() {
      //alert(document.Form1.scrollx.value);
      //alert(document.Form1.scrolly.value);
      window.scrollTo(document.Form1.scrollx.value-50,document.Form1.scrolly.value-50)
      
}

Then call scrollToCoordinates from body onLoad:

<body onload="javascript:scrollToCoordinates()" MS_POSITIONING="FlowLayout">
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.