L
Larry Lawhead
My problem is that IsValid returns TRUE when, based on Validation
Expression, result should be FALSE.
Properties (departing from defaults):
Enable Client Script: False (Just incase it matters)
Validation Expression: [0-9\.,]*
Code Example:
private void cbxAvailable_CheckedChanged(object sender, System.EventArgs e)
{
if(valWeight.IsValid == false)
{
valWeight.ErrorMessage = "Use numbers only.";
tbxProdWeight.Text = "";
}
}
I created a prototype using the same property settings that works just fine.
Here is the code from that example:
private void Button2_Click(object sender, System.EventArgs e)
{
if(RegularExpressionValidator1.IsValid)
{
Label1.Text = TextBox1.Text;
TextBox1.Text = "";
}
else if (RegularExpressionValidator1.IsValid == false)
{
Label1.Text = "";
TextBox1.Text = "";
}
}
I must be overlooking something quit simple here. Any suggestions?
Thanks!
Expression, result should be FALSE.
Properties (departing from defaults):
Enable Client Script: False (Just incase it matters)
Validation Expression: [0-9\.,]*
Code Example:
private void cbxAvailable_CheckedChanged(object sender, System.EventArgs e)
{
if(valWeight.IsValid == false)
{
valWeight.ErrorMessage = "Use numbers only.";
tbxProdWeight.Text = "";
}
}
I created a prototype using the same property settings that works just fine.
Here is the code from that example:
private void Button2_Click(object sender, System.EventArgs e)
{
if(RegularExpressionValidator1.IsValid)
{
Label1.Text = TextBox1.Text;
TextBox1.Text = "";
}
else if (RegularExpressionValidator1.IsValid == false)
{
Label1.Text = "";
TextBox1.Text = "";
}
}
I must be overlooking something quit simple here. Any suggestions?
Thanks!