I had tried SmartNavigation (replaced with MaintainScrollPositionOnPostback)
before, but for some reason it to does not work. I have a GridView on my
form that is tied to a large dataset (large in 30 or so rows), there are
buttons that are dynamically created and when pressed call a javascript
function. which looks like:
function confirmIt(url)
{
location.href = url;
}
Which now that I think about it, looks more like a redirect then a postback.
This could be why the above doesn't work for me.
I did however find the following on the web:
http://www.howtocreate.co.uk/tutoria.../browserwindow
Last of the sample code shows hot to get the x, y of the scroll and then I
also found
http://www.devhood.com/messages/mess...read_id=104625
Which had:
window.scrollTo(x, y);
This does the trick for me, for now. As I learn more and probably realize
what is wrong with my location.href I'll work on correcting it so I can use
the default property.
Thanks
Wayne
"Steven" <St****@discussions.microsoft.com> wrote in message
news:B4**********************************@microsof t.com...
If the users are using IE 5+ then set the DOCUMENT property of
'smartNavigation' to true.
"Wayne Sepega" wrote:
Ultimately what I need is a way to remember the scroll position of the
form
on a post back. I have a button that posts back to the current form and
if
there are no errors the form is reproduced, I want to scroll back to
where
the user was when they clicked on the button.
I have an ASPX page with the following doc type:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd" >
I'm not a 100% sure what all the above means, though I do know (from help
with a co-worker) that it determines how the document is generated on the
client side. I have to leave the doc type that way for our standards, but
still need to do the following.
I have the following JAVASCRIPT in the same page:
alert("You've scrolled to " + document.body.scrollTop + " pixels.");
With the doctype tag I always receive 0 for the value, but if I remove
the
doctype tag or set it to a different type, I receive the correct value.
Is
there an equivalent of scrollTop in the above doc type?
Any help or points in the right direction are appreciated.
Thanks
Wayne