Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > SmartNavigation and Determining If ValidationSummary Caught Any Errors

Reply
Thread Tools

SmartNavigation and Determining If ValidationSummary Caught Any Errors

 
 
Dan Sikorsky
Guest
Posts: n/a
 
      12-01-2004
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?

--
Thank you kindly,
Dan Sikorsky BAB, BScE, MSC


 
Reply With Quote
 
 
 
 
Viksi
Guest
Posts: n/a
 
      12-01-2004
You could add "#" to the address, or you could use java script to check for
the value of a hidden value field.
-Viksi

"Dan Sikorsky" wrote:

> 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?
>
> --
> Thank you kindly,
> Dan Sikorsky BAB, BScE, MSC
>
>
>

 
Reply With Quote
 
 
 
 
Dan Sikorsky
Guest
Posts: n/a
 
      12-02-2004
Could you clarify, with an informative example, what you mean by 'add # to
the address' and 'check for the value of a hidden field'?

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?

"Viksi" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
> You could add "#" to the address, or you could use java script to check

for
> the value of a hidden value field.
> -Viksi
>
> "Dan Sikorsky" wrote:
>
> > 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?
> >
> > --
> > Thank you kindly,
> > Dan Sikorsky BAB, BScE, MSC
> >
> >
> >



 
Reply With Quote
 
Viksi
Guest
Posts: n/a
 
      12-02-2004
Hello Dan,

Sorry for being to brief previously. You will be checking whether there were
any errors or not on the server side. If the condition is such that you want
to scroll at the top, you can do one of the following:

- Add "#" to the address of the response. For example, if your page is
errors.aspx, the address would be "http://.../errors.aspx#". This will cause
the scroll to top.

- Second option would be to createa hidden field where you specify 'True' or
'False' for example on whether you should scroll or not. Then, in java script
on the client side, you can check for the value of that hidden field to
determine whether you want to scroll or not.

I hope that helps.
-Viksi

"Dan Sikorsky" wrote:

> Could you clarify, with an informative example, what you mean by 'add # to
> the address' and 'check for the value of a hidden field'?
>
> 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?
>
> "Viksi" <(E-Mail Removed)> wrote in message
> news(E-Mail Removed)...
> > You could add "#" to the address, or you could use java script to check

> for
> > the value of a hidden value field.
> > -Viksi
> >
> > "Dan Sikorsky" wrote:
> >
> > > 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?
> > >
> > > --
> > > Thank you kindly,
> > > Dan Sikorsky BAB, BScE, MSC
> > >
> > >
> > >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
501 PIX "deny any any" "allow any any" Any Anybody? Networking Student Cisco 4 11-16-2006 10:40 PM
Page level errors not getting caught Keith Patrick ASP .Net 1 11-17-2005 04:29 PM
validationsummary duplicates errors Netwhiz ASP .Net Web Controls 0 02-17-2005 04:27 PM
Overriding SmartNavigation To Automatically See ValidationSummary At Top Of Page Dan Sikorsky ASP .Net 1 12-02-2004 06:12 PM
Errors, errors, errors Mark Goldin ASP .Net 2 01-17-2004 08:05 PM



Advertisments