[Mono-bugs] [Bug 37577][Wis] New - System.Web.UI.RangeValidator.EvaluateIsValid() produces incorrect results
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
Tue, 4 Feb 2003 04:56:20 -0500 (EST)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by stephanetombeur@hotmail.com.
http://bugzilla.ximian.com/show_bug.cgi?id=37577
--- shadow/37577 Tue Feb 4 04:56:20 2003
+++ shadow/37577.tmp.23213 Tue Feb 4 04:56:20 2003
@@ -0,0 +1,62 @@
+Bug#: 37577
+Product: Mono/Class Libraries
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: System.Web
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: stephanetombeur@hotmail.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: System.Web.UI.RangeValidator.EvaluateIsValid() produces incorrect results
+
+Description of Problem:
+
+System.Web.UI.RangeValidator.EvaluateIsValid() produces incorrect results
+
+if(ctrl == null || ctrl.Trim().Length == 0)
+{
+return true;
+}
+bool retVal = Compare(ctrl, MinimumValue,
+ValidationCompareOperator.GreaterThanEqual,ValidationDataType.String);
+if(!retVal)
+{
+retVal = Compare(ctrl,
+MaximumValue,ValidationCompareOperator.LessThanEqual,ValidationDataType.St
+ring);
+}
+return retVal;
+
+Solution:
+The second (LessThanEqual) comparison is never executed if the first one
+(GreaterThanEqual) is true.
+
+--> the discriminator for the second comparison should be "if (retval)"
+
+Also, you should not pass "ValidationDataType.String" by default to the
+Compare method, this should be the control's "Type" property (this way,
+you can pass ValidationDataType.Integer if needed)
+
+
+Steps to reproduce the problem:
+1.
+2.
+3.
+
+Actual Results:
+
+
+Expected Results:
+
+
+How often does this happen?
+
+
+Additional Information: