Hello,
I have an issue with the WebMaskEditor control. If I use this code on my ASPX page:
Zip:<ig:WebMaskEditor ID="mskZip" runat="server" CssClass="TextBox" InputMask="00000-0000" Width="90px" /><asp:RegularExpressionValidator ID="zipValidator" runat="server" ErrorMessage="Invalid Zip Code" ValidationExpression="(^(?!0{5})(\d{5})(-?)(?!0{4})((\d{4})||(_{4}))?$)" ControlToValidate="mskZip">*</asp:RegularExpressionValidator> I cannot get the validator and the WebMaskEditor to play well together. The issue that I am having is the validation control will mark the mskZip value as invalid when the value is "55555-".The regular expression I am using should allow "5555-". As a matter of fact, it works great if I replace the WebMaskEditor with a regular ASP textbox. So I guess the issue I am really having is that the RegularExpressionValidator doesn't work the same with the WebMaskEditor control as it does with an ASP textbox. I thought the issue might be that the validation control was seeingthe underscores in the WebMaskEditor control so I modified the regular expression to account for those. Testing it yielded the same results. Again, if I replace the WebMaskEditor with a textbox it works as I would expect.Here is what the code looks like whenever I replace the WebMaskEditor with a textbox:Zip:<asp:TextBox ID="mskZip" runat="server" CssClass="TextBox" Width="90px" /> <asp:RegularExpressionValidator ID="zipValidator" runat="server" ErrorMessage="Invalid Zip Code" ValidationExpression="(^(?!0{5})(\d{5})(-?)(?!0{4})((\d{4})||(_{4}))?$)" ControlToValidate="mskZip">*</asp:RegularExpressionValidator>
Any idea how I can work around this issue?
Kevin
Hello Kevin,Thank you for posting in our community. Can you please specify the exact version and build of NetAdvantage you are using. I will test the code and i will provide you with my findings. Also it would be nice if you specify the browsers you are using to test and your CLR.
Nikifor,
Thanks for your assistance.
I am using NetAdvantage ASP.NET 2010.3 (10.3.20103.1013)
Internet Explorer 9 (9.0.8112.16421)
Visual Studio 2010