Home Dashboard Directory Help
Search

ASP.NET RegularExpressionValidator bug by DaveyG1010


Status: 

Active


1
0
Sign in
to vote
Type: Bug
ID: 782006
Opened: 3/24/2013 9:19:51 PM
Access Restriction: Public
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description


When using a number of Validation Controls on a page, I was encountering a bug in which the form would submit even with invalid data.

I had RequiredFieldValidator Controls for a number of inputs in a form, and also a RegularExpressionValidator Control. Within this RegularExpressionValidator I had a rather large regular expression (the RFC 2822 standard Regex below);

(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])

With this regex in place, whenever I would enter bogus information into the email input on the form that had both this regularexpressionvalidator AND also a requiredfieldvalidator used on the email TextBox control, The rest of the form would be validate, even though it was either left blank or filled with invalid data. So this value appeared to cause the other validators to fail.

Once I changed the regex value to something smaller, such as this;

ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"

The form's validation behaviour returned to normal and the page would only validate with valid data.

Details
Sign in to post a comment.
Posted by Microsoft on 4/2/2013 at 2:05 AM
Hi, given that we have not heard back from you in 7 days. We will go ahead and close this Connect Issue. If you get a chance to review and provide the information requested earlier, you can go ahead and reactivate this issue.
Posted by Microsoft on 3/28/2013 at 3:44 AM
I am currently standing by for an update from you and would like to know how things are going on your end. If you could get back to me at your earliest convenience with information I request, we will be able to make headway towards a resolution. I look forward to hearing from you.
Posted by Microsoft on 3/25/2013 at 3:36 AM
Thank you for submitting feedback on Visual Studio and .NET Framework. In order to efficiently investigate and reproduce this issue, we are requesting additional information outlined below.

Could you please give us a demo project to demonstrate this issue so that we can conduct further research?

Please submit this information to us within 4 business days. We look forward to hearing from you with this information.

Microsoft Visual Studio Connect Support Team
Posted by Microsoft on 3/24/2013 at 9:52 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.