G
Guest
I created a regular express validator at runtime as the following, but the
html was rendered by putting the closing " in the separate line, which makes
the validation not working, example:
TableCell cellV = new TableCell();
RegularExpressionValidator rev = new RegularExpressionValidator();
rev.ControlToValidate = controlId;
rev.Text = " *Invalid format";
rev.EnableClientScript = true;
rev.Display = ValidatorDisplay.Dynamic;
rev.ValidationExpression = "^(\d{1,7})$"; <<<<<<<<<<<<<<
cellV.Wrap = false;
cellV.Controls.Add( rev );
The rendered html is
validationexpression="^(\d{1,7})$
"
The regular expression does not work with " in the following line. If I
removed the NEWLINE to have
validationexpression="^(\d{1,7})$". Then it works fine.
This is apprarently the ASP.NET 1.1 bug, does anyone know if there is a fix
or a workaround?
html was rendered by putting the closing " in the separate line, which makes
the validation not working, example:
TableCell cellV = new TableCell();
RegularExpressionValidator rev = new RegularExpressionValidator();
rev.ControlToValidate = controlId;
rev.Text = " *Invalid format";
rev.EnableClientScript = true;
rev.Display = ValidatorDisplay.Dynamic;
rev.ValidationExpression = "^(\d{1,7})$"; <<<<<<<<<<<<<<
cellV.Wrap = false;
cellV.Controls.Add( rev );
The rendered html is
validationexpression="^(\d{1,7})$
"
The regular expression does not work with " in the following line. If I
removed the NEWLINE to have
validationexpression="^(\d{1,7})$". Then it works fine.
This is apprarently the ASP.NET 1.1 bug, does anyone know if there is a fix
or a workaround?