473,569 Members | 2,901 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Validator messages

I have a page that is very long so I have set it up to page using <div> to
display or hide the different pages. When I get to the last page the user
submits the page.

This works great, except that if one of the validators finds an error and it
isn't on the last page, the user won't see it. What I want to do is know
that there is an error on the 2nd page and make that page visible (which
would show the validator error message) and the user can make his changes.

Is there a way to know that a validator has fired and which one fired?

Thanks,

Tom
Nov 19 '05 #1
3 1287
"tshad" <ts**********@f tsolutions.com> wrote in message
news:eG******** ******@TK2MSFTN GP15.phx.gbl...
I have a page that is very long so I have set it up to page using <div> to
display or hide the different pages. When I get to the last page the user
submits the page.

This works great, except that if one of the validators finds an error and
it isn't on the last page, the user won't see it. What I want to do is
know that there is an error on the 2nd page and make that page visible
(which would show the validator error message) and the user can make his
changes.

Is there a way to know that a validator has fired and which one fired?
I figured what I would do is to check all the validators and see if they
passed. Knowing what page the validator is on would allow me to make
visible the page that had the error.

The problem is that the "IsValid" doesn't seem to get set for the particular
validator, but the Page.IsValid does.

For example:

I have the following texbox and validator:

<asp:textbox id="ProfileName " columns="45" runat="server" />
<asp:RequiredFi eldValidator
id="NameValidat or"
ControlToValida te="ProfileName "
Display="Dynami c"
Text="Passport Name Required"
runat="server" />

I know that this validator is finding an error and setting the text to
display. It also sets the Page.IsValid correctly.

But when I run the following routine in the event that my submit button
calls, I get the NameValidator.I sValid showing as true and the Page.IsValid
showing as false.

Function CheckErrors() as Boolean
If NameValidator.I sValid then
trace.warn("Nam eValidator is true")
else
trace.warn("Nam eValidtor is false")
end if

if (Page.IsValid) then
trace.warn("Pag e Validator is true")
else
trace.warn("Pag e Validtor is false")
end if
end Function

Why is this?

Thanks,

Tom
Thanks,

Tom

Nov 19 '05 #2
Tom,

I might be misunderstandin g you, so I will apologize in advance if
reading this post has wasted precious moments that you will be unable
to recover =). From my understanding, you have a very long page that
is separated by <div> tags. My first suggestion would be to make these
panel controls. You can perform the same functionality by making the
panels visible and invisible.

The benefit that you will get from this is that you will be able to put
separate validation summary controls in EACH panel. Thus if a user is
going through a wizard type application, they will not be able to
continue to the next "page" (panel), until all validators in that
panel are valid.

Does that make sense? Each page (panel), would contain the user input
fields, validators for the necessary fields, and a validation summary.
Once a user clicks the next button to move to the next page (panel),
the validation would trigger. If it is valid, the next page is
displayed...rin se and repeat.

I hope this helps!
Aaron

Nov 19 '05 #3
"Aaron Corcoran" <ac*******@lase rs.state.la.us> wrote in message
news:11******** **************@ g43g2000cwa.goo glegroups.com.. .
Tom,

I might be misunderstandin g you, so I will apologize in advance if
reading this post has wasted precious moments that you will be unable
to recover =). From my understanding, you have a very long page that
is separated by <div> tags. My first suggestion would be to make these
panel controls. You can perform the same functionality by making the
panels visible and invisible.
Why would that be better than <div id="page1" visible="false"
runat="server"> ?

I was looking at some articles on the Web about using Panels, just as you
suggest, to break apart large pages into byte size pieces. They do the same
thing I do to display pages by setting the panel/div visible attribute to
true or false.

The benefit that you will get from this is that you will be able to put
separate validation summary controls in EACH panel. Thus if a user is
going through a wizard type application, they will not be able to
continue to the next "page" (panel), until all validators in that
panel are valid.
Do the validators work differently in Panels then Divs?

Does that make sense? Each page (panel), would contain the user input
fields, validators for the necessary fields, and a validation summary.
Once a user clicks the next button to move to the next page (panel),
the validation would trigger. If it is valid, the next page is
displayed...rin se and repeat.


Also, what about the Validators IsValid not showing as false when it fails
validation?

Thanks,

Tom
Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
9717
by: Alex M | last post by:
I'm trying to use the jakarta struts client side javascript validators and the validators are working, but they are not showing the popup messages. I have the message keys defined in the ApplicationResources.properties file, the propertise file is in the right location, it is referenced from the struts-config.xml, but still no messages. For...
24
3131
by: Nick Kew | last post by:
There's a new beta of the W3C Markup Validation Service now live at <URL:http://validator.w3.org:8001/> Probably the most important change is verbose output, including attempts to explain the validator errors. Other changes include improved display of error messages, and a choice of parse modes. Currently - but probably not for long - it...
195
8389
by: Torbjørn Pettersen | last post by:
As you might have noticed I'm trying to clean up my web site's HTML code. The way I do it is simply more or less redoing to complete site, testing it on a web server I have set up on my local network. I have downloaded, and installed CSE HTML Validator Pro, but I don't get the same results with that as I do with the online validator on...
4
1866
by: Mary Ellen Curtin | last post by:
I made a web page (wheee!) and decided to test it (by upload) in the W3C Validator http://validator.w3.org/ I had some errors, but as Bilbo said of Gandalf, "The explanation did not explain." In desperation I clicked randomly and ended up at the WDG Validator http://www.htmlhelp.com/tools/validator/ Their explanation were actually...
8
7407
by: Spartanicus | last post by:
The document at http://homepage.ntlworld.com/spartanicus/custom_dtd.htm uses a custom DTD, the w3c validator validates it but with this warning: "Unknown Parse Mode! The MIME Media Type (text/html) for this document is used to serve both SGML and XML based documents, and it is not possible to disambiguate it based on the DOCTYPE...
2
3892
by: Pham Nguyen | last post by:
Has anyone seen an example of a textbox server control that has built-in client-side validation? I'd like to build a server control that extends the System.Web.UI.WebControls.TextBox class to allow javascript checks for things like valid e-mail addresses or phone numbers (without having to add a separate control for validation). One idea I...
3
1663
by: Angelos Karantzalis | last post by:
Hi guys, I've a small problem with validators. I'm building a single .aspx file that handles all my form posts. I need to be using ASP.NET validators ( or subclasses thereof ), so what i do to overcome the fact that i don't really know what sort of input controls I'm working with is this: 1) I've got the form description in xml, so I...
8
7821
by: pmud | last post by:
Hi, I am using a compare validator in asp.net application(c# code). This Custom validator is used for comparing a value enterd by the user against the primary key in the SQL database. IF the VALUE ENTERED BY THE USER EXISTS IN THE DB , then THE ERROR MESSAGE OF THE COMPARE VALIDATOR SHOULD BE DISPLAYED. For this, I used the reference...
0
955
by: Paul | last post by:
Hi all, I want to use the same wrapper table and header text for all validator error messages. The validator controls don't appear to supply an easy method for using tags and formatting. What would be the easiest way to use the same table formatting for the error messages without a great deal of code repetition - subclass the validator...
37
3634
by: Prisoner at War | last post by:
Actually, it doesn't have to be a blockquote...but I'm at my wits' end: I want to make bold several lines of text which have a pair of <br /tags between them...seems like the <b></bdo not "carry over" when there are <br /tags involved...??? I've tried using <p style="font-weight: bold;"></p>, I've tried <blockquote></blockquote>...I just...
0
7693
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6277
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5501
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2105
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
933
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.