ASP.NET 1.1 Bug - Dynamic RE Validator

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?
 
G

Guest

SORRY, it did NOT put an extra NEWLINE before the closing ". And it is not
the .NET bug either.

I retrieved the RE from db table, and the newline was added when it was
copied from the other db. SQL 2000 was to blame.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top