Q
Q. John Chen
Following is the code from msdn:
private void Button1_Click(object sender, System.EventArgs e)
{
RangeValidator1.MinimumValue = txtArrival.Text;
RangeValidator1.MaximumValue = txtDeparture.Text;
RangeValidator1.Type = ValidationDataType.Date;
RangeValidator1.Validate();
if (!RangeValidator1.IsValid)
{
RangeValidator1.ErrorMessage = "The tour date must " +
"fall between the arrival and departure dates.";
}
}
It calls the Validate when the user entered the value.
My question. The validation control perform validate automatically. So
my guess is that the Validate() is already called AUTOMATICALLY BEFORE
the click event.
Am I right? or,
Is there a way to stop the autmatically calling of the validate()
method?
I my application, I actually have a customer Validator and no client
side validation.
Thanks
JOhn
private void Button1_Click(object sender, System.EventArgs e)
{
RangeValidator1.MinimumValue = txtArrival.Text;
RangeValidator1.MaximumValue = txtDeparture.Text;
RangeValidator1.Type = ValidationDataType.Date;
RangeValidator1.Validate();
if (!RangeValidator1.IsValid)
{
RangeValidator1.ErrorMessage = "The tour date must " +
"fall between the arrival and departure dates.";
}
}
It calls the Validate when the user entered the value.
My question. The validation control perform validate automatically. So
my guess is that the Validate() is already called AUTOMATICALLY BEFORE
the click event.
Am I right? or,
Is there a way to stop the autmatically calling of the validate()
method?
I my application, I actually have a customer Validator and no client
side validation.
Thanks
JOhn