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

    这个是我参考的方案

  • 相关阅读:
    echarts图表重设尺寸
    文本文档中各字母出现次数汇总(java)
    30道随机运算
    随机生成验证码
    原码,反码,补码
    动手动脑(一)
    模拟银行ATM系统(基础版)
    2018暑期周总结报告(五)
    2018暑期周总结报告(四)
    2018暑期周总结报告(三)
  • 原文地址:https://www.cnblogs.com/xiaofengju/p/5852675.html
Copyright © 2011-2022 走看看