Hi,
I made a form consisting of a lot of server-controls (dropdownlist,
radiobuttonlist ...). Some controls have their property 'autoPostBack' =
true because some things must happen when selectedvalue is changed.
My problem: suppose that the property 'autoPostBack' of 20th control is
true, each time the user changes the selectedvalue, he is sent back to the
top of the form after postback. He has then to scroll down to find the 21th
control.
Is there any way to impede that and to keep the same poition in the form
after postback?
Thanks
Dan
Teemu Keiski - 22 May 2008 19:38 GMT
Hi,
you can set MaintainScrollPositionOnPostBack="True" to Page directive
(starting in ASP.NET 2.0)

Signature
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net
> Hi,
>
[quoted text clipped - 12 lines]
> Thanks
> Dan
George Ter-Saakov - 22 May 2008 19:47 GMT
There is a property on the Page object in .NET 2.0
MaintainScrollPositionOnPostBack
Set it to true.
Basically when form is submitted JavaScript remembers current scroll
position in hidden variable (input type=hidden).
Then when page comes back from POST scroll position is restored with
JavaScript.
George.
> Hi,
>
[quoted text clipped - 12 lines]
> Thanks
> Dan
Dan - 22 May 2008 20:14 GMT
Thanks
> There is a property on the Page object in .NET 2.0
> MaintainScrollPositionOnPostBack
[quoted text clipped - 23 lines]
>> Thanks
>> Dan