views:

9

answers:

1

I've got an ASP.NET webform with asp:TextBox and asp:RequiredFieldValidator at the bottom of the page. If client side validation fails on form submit - the page scrolls all the way up.

I'd like to maintain the scroll position on failed client-side validation.

I've found this solution, but it seems overly complex.

Any ideas?

+1  A: 

The best approach I've found, after looking at this pretty deeply, is to put your error messages at the top of the page in a Summary.

pdr
weird, once i moved the validation summary to the top - scroll position stopped resetting. I have no idea why this happened - but thanks nevertheless.
roman m