469,609 Members | 1,687 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,609 developers. It's quick & easy.

Overriding SmartNavigation To Automatically See ValidationSummary At Top Of Page

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


Nov 18 '05 #1
1 2261
i assume you are doing server validation, as client validation already does
this. you will have to emit javascript that detects its in the smartnav
iframe, and scroll its parent window, or better yet, in the smartnav.js
update the __smartNav.restoreFocus function to do this for you.
-- bruce (sqlwork.com)


"Dan Sikorsky" <ds****@gte.net> wrote in message
news:u2*************@TK2MSFTNGP09.phx.gbl...
| 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
|
|
|
|
Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by John Mabbott | last post: by
2 posts views Thread by SLE | last post: by
3 posts views Thread by Christer | last post: by
4 posts views Thread by Bobby | last post: by
3 posts views Thread by Nestus | last post: by
7 posts views Thread by morrisdn13 | last post: by
1 post views Thread by Ken Varn | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.