Stefan Pienaar
I would love to change the world, but they won't give me the source code

ValidationSummary and MaintainScrollPositionOnPostback

March 11, 2011 18:19 by StefanPienaar

When a ValidationSummary is used on an asp.net page, the MaintainScrollPositionOnPostback property no longer works as expected when one of the validation controls fails. This is because the ValidationSummary calls "window.scrollTo(0,0)" when the page is not valid.

To work around the problem, overwrite the scrollTo function on the page:

<script language="javascript" type="text/javascript">

window.scrollTo = function () { }

</script>

Reference: http://forums.asp.net/t/1157863.aspx


Categories: .net
Actions: E-mail | Permalink | Comments (0)