我将简单的代码放在带有两个文本框的 ASP.net 中。文本框在 Chrome 上不起作用,但在 IE 上起作用。RequestValidator 在两个浏览器上都可以正常工作。当我尝试输入内容时,两个文本框(txtUserName/txtPassword)似乎在 Chrome 中被禁用,但它在 IE 上工作。
<tr>
<td>User Name</td>
<td style="padding-left:20px"> <asp:TextBox id="txtUserName" AutoPostBack=true runat="server" Width="80px" Enabled="true" /></td>
<td style="padding-left:20px"><asp:RequiredFieldValidator ForeColor="Red" Enabled="true" ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtUserName"
ErrorMessage="User Name is Mandatory">User Name is Mandatory</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>Password</td>
<td style="padding-left:20px"> <asp:TextBox id="txtPassword" runat="server" Width="80px" TextMode="Password" /></td>
<td style="padding-left:20px"> <asp:RequiredFieldValidator ForeColor="Red" ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtPassword"
ErrorMessage="Password is Mandatory">Password is Mandatory</asp:RequiredFieldValidator>
</td>
</tr>