I'm using SmartNavigation and need to automatically scroll to the top of the
page when the ValidationSummary control catches errors and displays them, so
that the user can see the errors without having to manually scroll to the
top.
How can I determine if the ValidationSummary will display errors so that I
can issue a javascript window.scrollTo(0,0) or document.body.scrollTop = 0
(or something more appropriate) to automatically scroll to the top of the
page, thereby circumventing the SmartNavigation feature?
In my .aspx file, I have:
<asp:validationsummary id="valValSummary" runat="server" headertext="There
are problems with the following fields:"></asp:validationsummary>
If no validation errors occur (no adjusting of the scroll position is
needed), then the user sees nothing. If validation errors exist, then the
user sees the headertext followed by each validation control's error message
in a bulleted list.
My first thought is to determine - on the server side during a postback - if
valValSummary is set to the headertext; how would this be done?
--
Thank you kindly,
Dan Sikorsky BAB, BScE, MSC