I am having problems with my ASP.NET 4 application in Chrome and Safari (works in Firefox and IE).
I have a button declared using the following code:
<asp:Button ID="btnEOI1" runat="server" CssClass="buttonCSS" Text="Lodge an Expression of Interest" OnClick="btnEOI_Click" CausesValidation="False" />
In the code file, I have the following code:
protected void btnEOI_Click(object sender, EventArgs e) { Response.Redirect("Default.aspx", true); }
Also on the page is LoginControl, which has two RequiredFieldValidators and RegularExpressionValidator:
<asp:requiredfieldvalidator id="UserNameRequired" runat="server" ControlToValidate="UserName" ErrorMessage="Please enter your User Name." SetFocusOnError="true" Display="None"> </asp:requiredfieldvalidator> <asp:RegularExpressionValidator runat="server" id="RegularExpressionValidator1" ControlToValidate="UserName" ErrorMessage="Please enter your User Name without spaces." ValidationExpression="[\S]+" Display="None" SetFocusOnError="true" > </asp:RegularExpressionValidator> <asp:requiredfieldvalidator id="PasswordRequired" runat="server" ControlToValidate="Password" ErrorMessage="Please enter your Password." SetFocusOnError="true" Display="None"> </asp:requiredfieldvalidator>
When I click a button in Chrome and Safari, the UserNameRequired and PasswordRequired validators work, although the button has CausesValidation = "false". Validation errors do not occur in IE or Firefox.
How can I stop the validators from starting in Chrome and Firefox?
source share