[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.

Content-Type: text/plain;
Content-Transfer-Encoding: 7bit

See the code attached.

    The property CutoffYear has the following documentation:

protected static int CutoffYear {get;}

Property Value
The maximum value that can be represented by a two digit year.

The maximum value depends on the system setttings.

    But the result that I get using the test code I wrote is:

CutoffYear: 2059
FullYear  : 2080

    I never knew that a two digit number can be so long ("2059")!

Gaurav Vaish

Content-Type: application/octet-stream;
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;

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());