asp.net中 服务器控件中onselectedindexchanged 没有反应的解决方案


最近发现项目中一个BUG就是 DropDownList 中的onselectedindexchanged 没有反应 AutoPostBack="true"和页面中的<%@ Page Language="C#" AutoEventWireup="true" %>

还是没有反应  各种百度  最终解决方案是  

<form id="T_Add" runat="server"  >
 <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
                </asp:ScriptManager>
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                  <Triggers>  
        <asp:PostBackTrigger ControlID="LinkButton2" />  //这里是最重要的解决方法
         <asp:AsyncPostBackTrigger ControlID="DropStage" EventName="SelectedIndexChanged" />
</Triggers>
                <ContentTemplate>

<asp:LinkButton ID="LinkButton2" runat="server" onclick="LinkButton2_Click">LinkButton</asp:LinkButton>

<asp:DropDownList ID="DropStage" 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

这个是我参考的方案


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM