-
gridview page index change with same page link
hi,
i have a web page with 2 gridviews stacked vertically, something like below.
|--------------- Gridview 1----------------------jump to GV 2-------------------|
|
|
|----------------------------------------------------------------------|
Back to top
|--------------------Gridview 2 ---------------------------------- |
|
|
|---------------------------------------------------------------------|
i have setup a same-page link at the top of the page to jump to the 2nd gridview, which works fine. my problem is:
when there are multiple pages of data returned in gridview2, and the user clicks '2' or '3' to go to the next page of gridview2 results, the page is reloaded and displays from the top.
question: is there a way to incorporate the same page link on page index change of the gridview? when the user changes pages in gridview2, have the page reload and jump to the named anchor on the page mypage.aspx#gridview2
thanks
-
alternate solution
well, after more digging, i figured out an alternate way to place the user at the second gridview. in case it will help anyone else:
added a javascript function to the page source that uses scrollintoview
-----------------------------------------------------------------------
<script type="text/javascript">
function scrollToStu()
{
var el = document.getElementById("studentgrid");
el.scrollIntoView(true);
}
</script>
---------------------------------------------------------------------------------------
next, in the code behind file, i added a registerStartupScript command in the PageIndexChanging function of the 2nd gridview.
protected void stugridView_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
RegisterStartupScript("scrolling", "<script>scrollToStu()</script>");
}
-
Similar Threads
-
By raindance in forum AJAX
Replies: 11
Last Post: 12-17-2008, 06:27 PM
-
By diverguy in forum ASP.NET
Replies: 4
Last Post: 04-11-2008, 04:54 PM
-
By Usha Dewasthali in forum XML
Replies: 3
Last Post: 06-14-2001, 10:39 AM
-
By santosh Kumar Racharla in forum Web
Replies: 1
Last Post: 02-14-2001, 05:24 PM
-
Replies: 0
Last Post: 08-31-2000, 05:48 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks