asp.net 点击按钮,页面没有任何变化,后台代码不触发
asp.net 点击按钮,页面没有任何变化,后台代码不触发
和可能是 asp.net button 缺少validationGroup 导致的,需要查看页面的validation并且让他们抛出错误信息
------案例如下,没有细细研究 ValidationGroup怎么用 <asp:DropDownList ID="ddl" runat="server" Width="154px" AutoPostBack="True" OnSelectedIndexChanged="ddl_SelectedIndexChanged"></asp:DropDownList> <asp:CompareValidator ID="cvabc" runat="server" ControlToValidate="ddl" ValidationGroup="save" ErrorMessage="<%$ Resources:xxx, xxx%>" Operator="NotEqual" ValueToCompare="-1">*</asp:CompareValidator> <asp:Button ID="btnSave" runat="server" class="button" Text="<%$ Resources:xxx, xxx%>" ValidationGroup="save" OnClick="btnSave_Click" />