Reputation: 179
Can i handle the browser scroll bar.
Cause my Aspx Page is to large.suppose if i hit a button on top so i want to set focus a control which is at the near bottom.
Is this Possible to scroll till that control...
Modified RequireMent.
Can a linkbutton in gridcontrol navigate to itself with setting the focus to control[Panel] on bottom of the page.
Upvotes: 0
Views: 174
Reputation: 18061
What about using the good ol' <a name="somewhereWayDown" />
(target) and <a href="#somewhereWayDown">go waaaay down</a>
?
... and for a bonus, add links back to the top:
<a name="top" />
<a href="#somewhereWayDown"></a>
<!-- lots of content here -->
<a name="somewherewaydown" />
<!-- some interesting content here -->
<a href="#top">Back to top</a>
<!-- even more content -->
<a href="#top">Back to top</a>
Upvotes: 0
Reputation: 4696
You could try
<a href='#myRequiredControl'>Go to my control</a>
.....lots of html in between.....
<div id='myControl'><a name='myRequiredControl'></a></div>
Upvotes: 1
Reputation: 1052
add a button, then add an OnClick handler that calls a javascript function like this :
function pageScroll() {
window.scrollBy(0,50); // horizontal and vertical scroll increments
var control = document.getElementById("yourControlName");
if( control != null ){control.focus();
}
Upvotes: 0