Connecting Tech Pros Worldwide Forums | Help | Site Map

Resetting scroll position in MaintainScrollPositionOnPostBack

Chris Rathman
Guest
 
Posts: n/a
#1: May 15 '06
Setting MaintainScrollPositionOnPostBack=true gets me the behavior I
most often want, but there are times when I need to have the scroll
position return to the top of the page - instead of the last scroll
position. Is there a way to reset the scroll position in an event
handler? From looking at the generated html, I see two hidden fields
that are embedded in the form:

<input type="hidden" name="__SCROLLPOSITIONX" id="__SCROLLPOSITIONX"
value="0" />
<input type="hidden" name="__SCROLLPOSITIONY" id="__SCROLLPOSITIONY"
value="100" />

Is there a way to access and change these values in a PostBack event?
I can see it as:

Request.Form["__SCROLLPOSITIONY"]

But this is a Read-Only access.

Thanks,
Chris Rathman


Closed Thread