|
-
Feb 2nd, 2004, 10:49 AM
#1
Thread Starter
Lively Member
Reset scroll position of a page
This must be an easy thing to do. In my app, I have a datagrid that I must scroll down the page to see. Then, when I click on an "exit" button with the following code behind
Response.Redirect("ThisPage.aspx", True)
The page is still scrolled down on "ThisPage.aspx".
How do I reset the scroll position to the top on "ThisPage.aspx"?
Thanks
-
Feb 2nd, 2004, 02:01 PM
#2
Hyperactive Member
Hi, I don't know if this is the best way but you could always enter a HTML bookmark in the page..
Then is your redirect statement
VB Code:
Response.Redirect("./MyRedirectedPage.aspx#TopOfPage")
HTH
MarkusJ
-
Feb 3rd, 2004, 09:43 PM
#3
Thread Starter
Lively Member
If I am passing a parm is the syntax
Response.Redirect("./MyRedirectedPage.aspx#TopOfPage?parm1=value")
Thanks for all the help!!
Last edited by jstansell; Feb 3rd, 2004 at 09:48 PM.
-
Feb 3rd, 2004, 09:52 PM
#4
Thread Starter
Lively Member
I tried this on a page that does not take a parm. It did not work. I think my problem is the fact that this page is actually inside an IFRAME. I need to scroll the parent form to top. Is there a way to access the parent form from a page that is inside an IFRAME?
-
Feb 4th, 2004, 02:16 PM
#5
Hyperactive Member
Hi, you will probably have to use javascript;
something like
VB Code:
document.frames[0].location = 'http://www.mysite.com#TopOfPage'
This will call the first frame in the document and set the location to the url you specified at the bookmark top of page.
hth
cheers
MarkusJ
-
Feb 4th, 2004, 02:50 PM
#6
Thread Starter
Lively Member
Does this work with IFRAME's?
-
Feb 4th, 2004, 02:57 PM
#7
Hyperactive Member
Hi, should do as an Iframe is just another frame and should be part of the frames collection of the document.
Basically, you just want to reload the page within the Iframe using Javascript (Check out Google for a page on how to do this).
Once you have that sorted, you then want to place a bookmark in the page that will be contained within the Iframe near the top of the page.
Once you have those two working combine the two
VB Code:
document.frames[0].location = 'http://www.mysite.com#TopOfPage'
This should get you started
Cheers
Mark
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
|
Click Here to Expand Forum to Full Width
|