嗨,我有一个像这样的RequiredFieldValidator
<asp:TextBox ID="txtEmployeeID" runat="server" MaxLength="255" CssClass="txt"
OnTextChanged="txtEmployeeID_TextChanged" AutoPostBack="True"
ValidationGroup="Save" ></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvEmployeeID" runat="server"
ErrorMessage="Employee ID is required information."
ControlToValidate="txtEmployeeID" Display="None" ValidationGroup="Save"
SetFocusOnError="True"></asp:RequiredFieldValidator>
和这样的按钮
<asp:Button ID="btnBlockUser" runat="server" Text="Block User"
CssClass="submitBtn " OnClick="btnBlockUser_Click"
OnClientClick="javascript:return confirm('Are you sure want to Block this user ?')"
ValidationGroup="Save" />
现在的问题是,如果我删除按钮中的 OnClientClick,则 RequriedFieldValidator 可以正常工作,如果我将其放回页面回帖而不显示任何错误消息,有人可以解释为什么会发生这种情况吗?