472,811 Members | 1,594 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,811 software developers and data experts.

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 2405
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: newusertodotnet | last post by:
I'm trying to add a ValidationSummary control to a common base page used by all of our system's aspx/ascx files. The base page is a regular class file that inherits from System.Web.UI.Page. When I...
0
by: John Mabbott | last post by:
Hello all, We're getting some weird behavior with the ValidationSummary control. If I submit a page that fires some validators, the ValidationSummary displays them correctly. However, if I...
2
by: SLE | last post by:
A web user control exposes a RadioButtonList (with AutoPostBack = true) called "Question". This control also has an embedded RequiredFieldValidator control. 1. Main ASPX page is populated with...
3
by: Christer | last post by:
Hi all! I recently created a MessageBox webcontrol for asp.net. This can be used as is, but I also want to take ude of it in other webcontrols. Right now i creating a ValidationSummary control,...
4
by: Bobby | last post by:
Hi all... I rather confuse using smartnavigation in my web application because if I set the "smartnavigation = true" then If I run my app, then after I post page that page, using event...
3
by: Nestus | last post by:
Hi, im developing a solution in ASP.Net, i have a page that i need to use the smartnavigation in true, the problem occurs when i put in the directive @Page SmartNavigation = true my page trhows a...
7
by: morrisdn13 | last post by:
I have encountered a very strange problem that makes it look like the page is not recreated in entirety after a postback when I turn on smartnavigation. If I click on a server control, the page...
1
by: Ken Varn | last post by:
If a page has multiple ValidationSummary controls, how does it distinguish which ValidationControls are associated with which ValidationSummary controls? The reason I am asking this is that I...
3
by: Ashhad Syed | last post by:
I have turned on smartnavigation=True for some of the forms in my .NET application. It seemed to be working fine on Windows 2000 SP4, which also has VS 2003 installted, but when I moved the...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.