johnfraser
Programmer
Hi there. Not new to C# but fairly new to ASP.net C#
I'm working with existing code and needed some explaination:
CompareValidator class and
ValidationCompareOperator.DataTypeCheck
========================
Why does this only support the following types?
String = 0,
Integer = 1,
Double = 2,
Date = 3,
Currency = 4,
Finally what would be the best way to support additional validation for other types...? CustomValidator?
I'm working with existing code and needed some explaination:
CompareValidator class and
ValidationCompareOperator.DataTypeCheck
Code:
public CompareValidator AddDataTypeValidator(WebControl controlToValidate, ValidationDataType dataType, string errorMessage)
{
CompareValidator dtv = new CompareValidator();
dtv.ID = GetValidatorName("dtv", controlToValidate);
dtv.ControlToValidate = GetControlIDForValidator(controlToValidate);
dtv.ErrorMessage = errorMessage;
dtv.Operator = ValidationCompareOperator.DataTypeCheck;
dtv.Type = dataType;
dtv.Display = ValidatorDisplay.None;
AddControl(dtv, controlToValidate);
return dtv;
}
========================
Why does this only support the following types?
String = 0,
Integer = 1,
Double = 2,
Date = 3,
Currency = 4,
Finally what would be the best way to support additional validation for other types...? CustomValidator?