asp.net中 服务器控件中onselectedindexchanged 没有反应的解决方案
最近发现项目中一个BUG就是 DropDownList 中的onselectedindexchanged 没有反应 AutoPostBack="true"和页面中的<%@ Page Language="C#" AutoEventWireup="true" %>
还是没有反应 各种百度 最终解决方案是
<form > <asp:ScriptManager runat="server" EnablePageMethods="true"> </asp:ScriptManager> <asp:UpdatePanel runat="server"> <Triggers> <asp:PostBackTrigger Control /> //这里是最重要的解决方法 <asp:AsyncPostBackTrigger Control EventName="SelectedIndexChanged" /> </Triggers> <ContentTemplate> <asp:LinkButton runat="server" onclick="LinkButton2_Click">LinkButton</asp:LinkButton> <asp:DropDownList runat="server" CssClass="select01" onselectedindexchanged="DropStage_SelectedIndexChanged" AutoPostBack="true"> <asp:ListItem Value="">-选择-</asp:ListItem> </asp:DropDownList> </ContentTemplate> </asp:UpdatePanel> </form>
http://www.reader8.cn/jiaocheng/20130626/1657444.html
这个是我参考的方案