473,395 Members | 2,783 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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("Before Test on Page.IsValid")
if not Page.IsValid then Exit Sub
trace.warn("After 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 1246
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**********@ftsolutions.com> wrote in message
news:Oy**************@tk2msftngp13.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("Before Test on Page.IsValid")
if not Page.IsValid then Exit Sub
trace.warn("After 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*************@TK2MSFTNGP15.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("Before Test on Page.IsValid")
Page.Validate()
if not Page.IsValid then Exit Sub
trace.warn("After 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**********@ftsolutions.com> wrote in message
news:Oy**************@tk2msftngp13.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("Before Test on Page.IsValid")
if not Page.IsValid then Exit Sub
trace.warn("After 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.googlegr oups.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:CompareValidator
ControlToValidate="WagesMin"
ControlToCompare="WagesMax"
Operator="LessThanEqual"
Type="Currency"
Display="Dynamic"
Text="<br>Minumum 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**********@ftsolutions.com> wrote in message
news:Ok**************@TK2MSFTNGP09.phx.gbl...

"Swanand Mokashi" <sw***********@swanandmokashi.com> wrote in message
news:OK*************@TK2MSFTNGP15.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("Before Test on Page.IsValid")
Page.Validate()
if not Page.IsValid then Exit Sub
trace.warn("After 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**********@ftsolutions.com> wrote in message
news:Oy**************@tk2msftngp13.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("Before Test on Page.IsValid")
if not Page.IsValid then Exit Sub
trace.warn("After 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 GreaterThanEqual and both gave me
errors.

I have the code set as:

trace.warn("WagesMin = " & WagesMin.Text & " WagesMax = " & WagesMax.Text)
trace.warn("Before Test on Page.IsValid")
Page.Validate()
if not Page.IsValid then Exit Sub
trace.warn("After 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**********@ftsolutions.com> wrote in message
news:Om*************@TK2MSFTNGP09.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:CompareValidator
ControlToValidate="WagesMin"
ControlToCompare="WagesMax"
Operator="LessThanEqual"
Type="Currency"
Display="Dynamic"
Text="<br>Minumum 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**********@ftsolutions.com> wrote in message
news:Ok**************@TK2MSFTNGP09.phx.gbl...

"Swanand Mokashi" <sw***********@swanandmokashi.com> wrote in message
news:OK*************@TK2MSFTNGP15.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("Before Test on Page.IsValid")
Page.Validate()
if not Page.IsValid then Exit Sub
trace.warn("After 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**********@ftsolutions.com> wrote in message
news:Oy**************@tk2msftngp13.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("Before Test on Page.IsValid")
if not Page.IsValid then Exit Sub
trace.warn("After 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
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...
41
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...
3
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...
4
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...
4
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...
3
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...
5
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...
4
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...
9
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......
2
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....
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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,...

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.