zoukankan      html  css  js  c++  java
  • 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

    这个是我参考的方案

  • 相关阅读:
    BestCoder Round #32
    USACO Runaround Numbers
    USACO Subset Sums
    USACO Sorting a Three-Valued Sequence
    USACO Ordered Fractions
    USACO 2.1 The Castle
    Codeforces Round #252 (Div. 2)
    Codeforces Round #292 (Div. 2)
    BZOJ 1604: [Usaco2008 Open]Cow Neighborhoods 奶牛的邻居
    BZOJ 1603: [Usaco2008 Oct]打谷机
  • 原文地址:https://www.cnblogs.com/xiaofengju/p/5852675.html
Copyright © 2011-2022 走看看