pinky1307
asked on
I am adding regular expressions dynamically. I have to write the validation expression in code behind. But when i add the expression, it says, invalid escape sequence. What can i do??
I am adding regular expressions dynamically. I have to write the validation expression in code behind. But when i add the expression, it says, invalid escape sequence. What can i do??
what expression do you write?
ASKER
"^[+-]?\d+(\.\d+)?$"
ASKER
Thanks for the reply. for integer or float values and for integer or decimal values. it takes "." and "\" as escape sequences
ASKER
RegularExpressionValidator rv = new RegularExpressionValidator ();
rv.ID = rev;
rv.ControlToValidate = tb.ID;
rv.ErrorMessage = "Must be an integer ";
rv.Text = "*";
rv.ValidationExpression = ("^[+-]?\d+(\.\d+)?$");
this is the code i use.
rv.ID = rev;
rv.ControlToValidate = tb.ID;
rv.ErrorMessage = "Must be an integer ";
rv.Text = "*";
rv.ValidationExpression = ("^[+-]?\d+(\.\d+)?$");
this is the code i use.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you.