473,698 Members | 2,603 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Validation problem

I have been having some issues trying to get validation to work. On most of
my pages, I have no problem.

But I have a page that has 4 validation objects and none are displaying an
error message, but I have this code:

trace.warn("Bef ore Test on Page.IsValid")
if not Page.IsValid then Exit Sub
trace.warn("Aft er Test on Page.IsValid")

And I never get to the the 2nd trace statement.

How do I find out what it found was not valid?

Thanks,

Tom
Feb 6 '06 #1
6 1257
Are you calling the Page.Validate method before checking for Page.IsValid ?
--
Swanand Mokashi
Microsoft Certified Solution Developer (.NET) - Early Achiever
Microsoft Certified Application Developer (.NET)

http://www.swanandmokashi.com/
http://www.swanandmokashi.com/HomePage/WebServices/
Home of the Stock Quotes, Quote of the day and Horoscope web services
"tshad" <ts**********@f tsolutions.com> wrote in message
news:Oy******** ******@tk2msftn gp13.phx.gbl...
I have been having some issues trying to get validation to work. On most
of my pages, I have no problem.

But I have a page that has 4 validation objects and none are displaying an
error message, but I have this code:

trace.warn("Bef ore Test on Page.IsValid")
if not Page.IsValid then Exit Sub
trace.warn("Aft er Test on Page.IsValid")

And I never get to the the 2nd trace statement.

How do I find out what it found was not valid?

Thanks,

Tom

Feb 6 '06 #2
sam
Set a breakpoint and look at Page.Validators array. You'll be able to
check the IsValid property and by their error messages you can tell
which one in failing.

Feb 6 '06 #3

"Swanand Mokashi" <sw***********@ swanandmokashi. com> wrote in message
news:OK******** *****@TK2MSFTNG P15.phx.gbl...
Are you calling the Page.Validate method before checking for Page.IsValid
?
No.

I never do on any of my pages.

I do have 2 ImageButtons on my screen. Both events have the same problem.

Why on my other pages does it work ok?

BTW, I did add the Page.Validate:

trace.warn("Bef ore Test on Page.IsValid")
Page.Validate()
if not Page.IsValid then Exit Sub
trace.warn("Aft er Test on Page.IsValid")

And it still doesn't show the 2nd trace.warn nor does it show the messages
from the Validation objects.

Thanks,

Tom


--
Swanand Mokashi
Microsoft Certified Solution Developer (.NET) - Early Achiever
Microsoft Certified Application Developer (.NET)

http://www.swanandmokashi.com/
http://www.swanandmokashi.com/HomePage/WebServices/
Home of the Stock Quotes, Quote of the day and Horoscope web services
"tshad" <ts**********@f tsolutions.com> wrote in message
news:Oy******** ******@tk2msftn gp13.phx.gbl...
I have been having some issues trying to get validation to work. On most
of my pages, I have no problem.

But I have a page that has 4 validation objects and none are displaying
an error message, but I have this code:

trace.warn("Bef ore Test on Page.IsValid")
if not Page.IsValid then Exit Sub
trace.warn("Aft er Test on Page.IsValid")

And I never get to the the 2nd trace statement.

How do I find out what it found was not valid?

Thanks,

Tom


Feb 6 '06 #4
"sam" <sa************ *@gmail.com> wrote in message
news:11******** **************@ g43g2000cwa.goo glegroups.com.. .
Set a breakpoint and look at Page.Validators array. You'll be able to
check the IsValid property and by their error messages you can tell
which one in failing.


How would I do that using trace.warn?

I am using DW and not Visual Studio and one page not code-behind.

Thanks,

Tom
Feb 6 '06 #5
I found the problem, but not sure why.

I had a Validation object I had commented out, but the program was still
seeing it.

<!--
<asp:CompareVal idator
ControlToValida te="WagesMin"
ControlToCompar e="WagesMax"
Operator="LessT hanEqual"
Type="Currency"
Display="Dynami c"
Text="<br>Minum um Wage must be less than or equal to the Maximum
Wage"
runat="server"/>
-->

I didn't realize that the ">" would stop the comment. If this is the case,
I would have assume there would be an error, or it would just show the rest
of the asp command on the output page, but it doesn't.

Why is that?

Thanks,

Tom

"tshad" <ts**********@f tsolutions.com> wrote in message
news:Ok******** ******@TK2MSFTN GP09.phx.gbl...

"Swanand Mokashi" <sw***********@ swanandmokashi. com> wrote in message
news:OK******** *****@TK2MSFTNG P15.phx.gbl...
Are you calling the Page.Validate method before checking for Page.IsValid
?


No.

I never do on any of my pages.

I do have 2 ImageButtons on my screen. Both events have the same problem.

Why on my other pages does it work ok?

BTW, I did add the Page.Validate:

trace.warn("Bef ore Test on Page.IsValid")
Page.Validate()
if not Page.IsValid then Exit Sub
trace.warn("Aft er Test on Page.IsValid")

And it still doesn't show the 2nd trace.warn nor does it show the messages
from the Validation objects.

Thanks,

Tom


--
Swanand Mokashi
Microsoft Certified Solution Developer (.NET) - Early Achiever
Microsoft Certified Application Developer (.NET)

http://www.swanandmokashi.com/
http://www.swanandmokashi.com/HomePage/WebServices/
Home of the Stock Quotes, Quote of the day and Horoscope web services
"tshad" <ts**********@f tsolutions.com> wrote in message
news:Oy******** ******@tk2msftn gp13.phx.gbl...
I have been having some issues trying to get validation to work. On most
of my pages, I have no problem.

But I have a page that has 4 validation objects and none are displaying
an error message, but I have this code:

trace.warn("Bef ore Test on Page.IsValid")
if not Page.IsValid then Exit Sub
trace.warn("Aft er Test on Page.IsValid")

And I never get to the the 2nd trace statement.

How do I find out what it found was not valid?

Thanks,

Tom



Feb 6 '06 #6
The reason I had commented it out was I could not get the Object to work.

I tried it as both LessThanEqual and GreaterThanEqua l and both gave me
errors.

I have the code set as:

trace.warn("Wag esMin = " & WagesMin.Text & " WagesMax = " & WagesMax.Text)
trace.warn("Bef ore Test on Page.IsValid")
Page.Validate()
if not Page.IsValid then Exit Sub
trace.warn("Aft er Test on Page.IsValid")

and the 1st trace gives me:

WagesMin = $150.00 WagesMax = $300.00

MS says that Currency is a decimal field with currency symbols, which I have
here.

So why doesn't it work?

Thanks,

Tom

"tshad" <ts**********@f tsolutions.com> wrote in message
news:Om******** *****@TK2MSFTNG P09.phx.gbl...
I found the problem, but not sure why.

I had a Validation object I had commented out, but the program was still
seeing it.

<!--
<asp:CompareVal idator
ControlToValida te="WagesMin"
ControlToCompar e="WagesMax"
Operator="LessT hanEqual"
Type="Currency"
Display="Dynami c"
Text="<br>Minum um Wage must be less than or equal to the Maximum
Wage"
runat="server"/>
-->

I didn't realize that the ">" would stop the comment. If this is the
case, I would have assume there would be an error, or it would just show
the rest of the asp command on the output page, but it doesn't.

Why is that?

Thanks,

Tom

"tshad" <ts**********@f tsolutions.com> wrote in message
news:Ok******** ******@TK2MSFTN GP09.phx.gbl...

"Swanand Mokashi" <sw***********@ swanandmokashi. com> wrote in message
news:OK******** *****@TK2MSFTNG P15.phx.gbl...
Are you calling the Page.Validate method before checking for
Page.IsValid ?


No.

I never do on any of my pages.

I do have 2 ImageButtons on my screen. Both events have the same
problem.

Why on my other pages does it work ok?

BTW, I did add the Page.Validate:

trace.warn("Bef ore Test on Page.IsValid")
Page.Validate()
if not Page.IsValid then Exit Sub
trace.warn("Aft er Test on Page.IsValid")

And it still doesn't show the 2nd trace.warn nor does it show the
messages from the Validation objects.

Thanks,

Tom


--
Swanand Mokashi
Microsoft Certified Solution Developer (.NET) - Early Achiever
Microsoft Certified Application Developer (.NET)

http://www.swanandmokashi.com/
http://www.swanandmokashi.com/HomePage/WebServices/
Home of the Stock Quotes, Quote of the day and Horoscope web services
"tshad" <ts**********@f tsolutions.com> wrote in message
news:Oy******** ******@tk2msftn gp13.phx.gbl...
I have been having some issues trying to get validation to work. On
most of my pages, I have no problem.

But I have a page that has 4 validation objects and none are displaying
an error message, but I have this code:

trace.warn("Bef ore Test on Page.IsValid")
if not Page.IsValid then Exit Sub
trace.warn("Aft er Test on Page.IsValid")

And I never get to the the 2nd trace statement.

How do I find out what it found was not valid?

Thanks,

Tom



Feb 6 '06 #7

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

Similar topics

21
3910
by: Stefan Richter | last post by:
Hi, after coding for days on stupid form validations - Like: strings (min / max length), numbers(min / max value), money(min / max value), postcodes(min / max value), telefon numbers, email adresses and so on. I thought it might be a better way to programm an automated, dynamic form validation that works for all kinds of fields, shows the necessary error messages and highlights the coresponding form fields.
41
2641
by: Gérard Talbot | last post by:
Cross-posted to: comp.infosystems.www.authoring.html and alt.html Followup-to: comp.infosystems.www.authoring.html 1- One day, I stumbled across a website that offers to validate webpages. What was really special about that site is that the validation service was available in Russian, German, Spanish and English. Now, I can't find this site anymore. I did search google. Do you know such site? What's its url? 2- Generally speaking, the...
3
2234
by: Kent Ogletree | last post by:
I am porting a Java XML Validation class over to C# and I am having a problem finding exactly what I need to acomplish the task. First I need to test for well formedness. I know this is usually something that does not need to be done, however in this case it is required. Is the best way to do this to validate to the schema and if no exception is thrown it must be well formed? What exception would be thrown if the document is found to not...
4
2369
by: | last post by:
Hello Guys, I am using the validation controls to validate my data. But the problem is "The page is still being posted to server". I want to get rid of the round trips to server. Are there any get arounds for this problem apart from the traditional JavaScript?
4
10145
by: usl2222 | last post by:
Hi folks, I appreciate any assistance in the following problem: I have a form with a bunch of dynamic controls on it. All the controls are dynamically generated on a server, including all the validators. The user enters the data, presses OK. My OK button is dynamically generated as well, with some code-behind logic in
3
2824
by: john morales | last post by:
Hi guys, I have a problem and i know there must be a solution for this as it is such a basic common practice in asp.net development. Scenario: i have many webforms in a site, most with two different custom controls, one is a login module, the other is a generic data entry module. When there are no validation controls on the page there is no problem. But when the the data entry module has validation controls, the login module triggers...
5
3241
by: Chris | last post by:
Based upon some prevoius postings on what to do for adding a 'add' row to a datagrid I utilize the footer to create the 'add' row. The only issue is that I have it sharing the 'UpDate_Command' and I use an argument to difference between an 'edit' vs. and 'add. But since I have field validation on both 'footer' and 'edit' columns I can't submit my edits since the footer validation kicks in.If I take the validation off then the both work fine...
4
2972
by: David Colliver | last post by:
Hi all, I am having a slight problem that hopefully, someone can help me fix. I have a form on a page. Many items on the form have validation controls attached. Also on this form are linkbuttons which must not cause validation. I have found a setting "causeValidation" to disable the validation. Also on the page, I have a datagrid that I will edit lines on. I can click
9
3181
by: Bill Long | last post by:
I have a control that simply displays a list of links. Following one of the links doesn't post back or redirect to another page, it simply hides the current panel and shows the one you selected... So the behavour is similar to a tab control. The user is expected to fill out required data on each of the panels before pressing a submit button which is visible from all panels. Problem I have is validating the data entered by the user. I...
2
4510
by: dustbort | last post by:
I recently had a problem where my required field validator stopped working. But, the page still posted back and tried to insert a record into the database without performing server-side validation. I discovered that there was no aspnet_client folder in the root of my IIS Web site, and when I ran "aspnet_regiis -c", client-side validation was working again. However, what I don't understand is why the required field validator did not...
0
8680
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8609
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8871
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7738
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6528
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5861
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
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
2
2335
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.