Resetting scroll position in MaintainScrollPositionOnPostBack

C

Chris Rathman

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top