如何实现改变dropdownlist的值触发事件但是不刷新页面。

解决方案 »

  1.   

          <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
        <div>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                   <asp:DropDownList ID="ddlLB" runat="server" Width="15%" AutoPostBack="True" OnSelectedIndexChanged="ddlLB_SelectedIndexChanged">
                   </asp:DropDownList>
                     <asp:DropDownList ID="ddlChild" runat="server" Width="20%">
                   </asp:DropDownList>
                     </ContentTemplate>
            </asp:UpdatePanel>
            </div> 
      

  2.   

    用scriptmanager和updatepanel结合,楼上就是正解,晚了一步
      

  3.   

    添加onchange事件c#:ddlLB.Attributes.Add("onchange","getValue();")getValue自己写个js方法就行
      

  4.   

    谢谢大家啊,这个问题自己解决了,是用js的,因为我的项目不是Ajax项目,所以2,3 楼的方法不行啊!但还是谢谢大家!