Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有谁知道我可以做类似Page_ClientValidate的方式,而不是验证页面上的所有控件?即我如何才能验证特定的自定义验证器是否有效?
Page_ClientValidate
您可以指定一个 ValidationGroup 来对控件进行分组。然后像这样将该字符串指定给 Page_ClientValidate 函数
<asp:TextBox id="text" runat="server" ValidationGroup="vld1" /> <asp:CheckBox id="check" runat="server" ValidationGroup="vld2" /> Page_ClientValidate('vld1');