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

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

<form   >
 <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

这个是我参考的方案

相关文章:

  • 2021-11-16
  • 2022-12-23
  • 2021-08-02
  • 2022-02-28
  • 2022-12-23
  • 2021-11-25
  • 2022-01-09
  • 2022-02-18
猜你喜欢
  • 2022-12-23
  • 2021-11-22
  • 2022-12-23
  • 2021-08-17
  • 2022-12-23
  • 2021-05-29
  • 2022-12-23
相关资源
相似解决方案