Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Closed Issue: Encoded expressions for Regex validation [231]

$
0
0
The expression defined using DataAnnotation in the server-side code is HTML encoded when rendered as an attribute, i.e. this:

[RegularExpression(@"^[^,<>\s@]+@([^\s,@\.\[\]]+\.)*[^\s,@\.\[\]]+\.[^\s,@\.\[\]]+$", ErrorMessage = "Invalid Email")]
public string EmailAddress { get; set; }

is rendered as:

data-val-regex-pattern="^[^,&lt;&gt;\s@]+@([^\s,@\.\[\]]+\.)*[^\s,@\.\[\]]+\.[^\s,@\.\[\]]+$"

The result is an invalid validation expression.
Comments: We cannot repro this issue. Please see discussion for details.

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>