Andrew
Andrew

Reputation: 179

Do the Scrolling in Client Brower Window

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

Answers (4)

Filburt
Filburt

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

Jibi Abraham
Jibi Abraham

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

M0-3E
M0-3E

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

denolk
denolk

Reputation: 770

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

Also check this answer.

Upvotes: 0

Related Questions