HELP: Page.MaintainScrollPositionOnPostback implementation

A

Axel Dahmen

Hi,

I've tried using the Page.MaintainScrollPositionOnPostback property to keep
the users' focus on the web control they are currently editing on
AutoPostBack=true. Yet, there are cases when I DON'T want the scroll
position to be maintained on postback, e.g. when server-side errors occur,
being displayed at the top of the page.

With MaintainScrollPositionOnPostback=true users don't get to see the error
list and, thus, wonder why they can't submit the page.

I've tried to set the MaintainScrollPositionOnPostback property
conditionally, but I noticed an awkward behaviour of the
MaintainScrollPositionOnPostback: It is NOT being interpreted for the
current render cycle, but instead it only defines how the page behaves with
the NEXT postback.

This brings up two questions:

a) Why is this property defined as a property instead of being a Page
directive if it can be set to a constant value only?

b) Is there a workaround? MaintainScrollPositionOnPostback seems to render
client code which is interpreted and used for the next render cycle if
present. Is it possible to conditionally suppress the
MaintainScrollPositionOnPostback information returned by the "first"
postback?

TIA,
Axel Dahmen
 

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,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top