如何使DropDownList在单击他后面的那个三角时加载数据啊~!

解决方案 »

  1.   

    用JS写,添加个onclick事件
    页面:
        <asp:DropDownList ID="DropDownList1" runat="server"  onclick="DpClick()">
        </asp:DropDownList>
        <asp:Button ID="Button1" runat="server" onclick="Button1_Click1" 
            Text="Button" />js:
        <script type="text/javascript">
            function DpClick() {
                document.getElementById("Button1").click();
            }
        </script>
    这样点击DropDownList1去执行Button1的click事件,
    你也可将Button1隐藏起来,同样能够执行!!
      

  2.   

    你这样不是又要刷新页面吗 用 ajax
      

  3.   

    asp.net的控件不要用了,用html的select吧,单击事件里用ajax请求远程的一个ashx页面,ajax有回调函数的,这个ashx页面返回数据,你再在回调函数里处理返回的数据,绑定到select控件上。
    <select id="s1" onclick="onClickSelect()"><select>
    function onClickSelect()
    {
        ajax请求某页面,返回你的数据,假设你的数据是string形式的一些人名“a,b,c”假设回调函数为 do(返回的数据做参数)
    }
    var selectHtml="";//定义一个变量记录下拉框里的html代码
    function do(返回的数据暂名 str)
    {
        var name=str.split(',');
        for(var i=0;i<name.length;i++)
        {
            selectHtml+=("<option>"+name[i]+"</option>")
            
        }
        document.getElementById("s1").innerHTML=selectHtml;
    }
      

  4.   

    同志们,和你们说了吧,我做的是一个店铺注册页面,因为企业会在全国连锁,所以就要有多少省市DropDownList让他们选择。少说有10几个~!你们说这些DropDownList的数据邦定就够我喝一壶的了~!
      

  5.   

    兄弟不要老挂计着DropDownList了,微软的控件就是一堆垃圾,还是用html的控件吧,有数据的就用ajax去取,再用js绑,哥把思路都给你讲了,再仔细琢磨琢磨,有什么不会的上w3cschool搜一下