gprabaka Posted January 9, 2007 Posted January 9, 2007 Hello, I have an ASP.NET page on which I have 5 GridViews. On each gridview I have a link column which will display the child info on the next gridview. When I click and display the next gridview I want to make the page scroll down to the location of that gridview, without the user having to scroll down. Can anyone tell me a good way to do this. Thanks Guha Quote
LostProgrammer Posted January 18, 2007 Posted January 18, 2007 you could use a javascript function and then when the link is clicked call RegisterStartupScript or add onclick attribute to link when it is databound in the grid. i'm sure there are other ways but this is how i've done it. Page.RegisterStartupScript("ScrollToPosition", String.Format("<script language='javascript'>ScrollToElem('{0}')</script>", String)); <script type="text/javascript" language="javascript"> function ScrollToElem(elemId) { var elem = document.getElementById(elemId); if (elem == null) { return; } elem.scrollIntoView(true); } </script> -lp Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.