[Mono-list] Bug in M$'s BaseCompareValidator class
Gaurav Vaish
gvaish@iitk.ac.in
Tue, 30 Oct 2001 09:30:24 +0530
This is a multi-part message in MIME format.
------=_NextPart_000_0029_01C16125.80E28E60
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: 7bit
See the code attached.
The property CutoffYear has the following documentation:
--------
[C#]
protected static int CutoffYear {get;}
Property Value
The maximum value that can be represented by a two digit year.
Remarks
The maximum value depends on the system setttings.
-------
But the result that I get using the test code I wrote is:
D:\dotNet>BaseCompareValidatorTest
CutoffYear: 2059
FullYear : 2080
I never knew that a two digit number can be so long ("2059")!
Cheers,
Gaurav Vaish
----------------------------
------=_NextPart_000_0029_01C16125.80E28E60
Content-Type: application/octet-stream;
name="BaseCompareValidatorTest.cs"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="BaseCompareValidatorTest.cs"
using System;
using System.Globalization;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public class BaseCompareValidatorTest: BaseCompareValidator
{
public BaseCompareValidatorTest(): base()
{
//Do nothing
}
public int cut()
{
return CutoffYear;
}
public int full()
{
return GetFullYear(80);
}
protected override bool EvaluateIsValid()
{
return false;
}
public static void Main()
{
BaseCompareValidatorTest bcvt = new BaseCompareValidatorTest();
System.Console.WriteLine("CutoffYear: " + bcvt.cut());
System.Console.WriteLine("FullYear : " + bcvt.full());
}
}
------=_NextPart_000_0029_01C16125.80E28E60--