0
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.

Andrew
  • 179
  • 2
  • 15

4 Answers4

1

You could try

<a href='#myRequiredControl'>Go to my control</a>
.....lots of html in between.....
<div id='myControl'><a name='myRequiredControl'></a></div>
Jibi Abraham
  • 4,636
  • 2
  • 31
  • 60
0

In javascript, you can get the position of the specific element on screen and programmatically scroll to that position.

Also check this answer.

Community
  • 1
  • 1
denolk
  • 765
  • 14
  • 27
0

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();
}
M0-3E
  • 1,012
  • 2
  • 13
  • 22
0

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>
Filburt
  • 17,626
  • 12
  • 64
  • 115