Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP.NET 1.1 Bug - Dynamic RE Validator

Reply
Thread Tools

ASP.NET 1.1 Bug - Dynamic RE Validator

 
 
=?Utf-8?B?U3RldmUgV29uZGVyZnVs?=
Guest
Posts: n/a
 
      03-01-2006
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?

 
Reply With Quote
 
 
 
 
=?Utf-8?B?U3RldmUgV29uZGVyZnVs?=
Guest
Posts: n/a
 
      03-01-2006
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.



"Steve Wonderful" wrote:

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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
*bug* *bug* *bug* David Raleigh Arnold Firefox 12 04-02-2007 03:13 AM
Struts Validator - creditCard validator smrimell@gmail.com Java 4 02-13-2007 08:32 PM
Re: Bug in IE that lets user delete validator errormessage? Roger Kjærnsrød ASP .Net 1 09-21-2004 03:50 PM
asp.net Dynamic display Validator bug!! coollzh ASP .Net 0 06-03-2004 04:19 PM
Validator/Textbox/Label Bug Scott ASP .Net 0 04-22-2004 09:28 PM



Advertisments