| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 418 人关注过本帖
标题:DropDownList关联问题
只看楼主 加入收藏
yxhrgyj
Rank: 1
等 级:新手上路
帖 子:22
专家分:0
注 册:2012-2-5
结帖率:100%
收藏
 问题点数:0 回复次数:1 
DropDownList关联问题
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        string[] CarArray = new string[4] { "Ford", "Honda", "BMW", "Dodge" };
        string[] AirplaneArray = new string[3] { "Boeing 777", "Boeing 747", "Boeing 737" };
        string[] TrainArray = new string[3] { "Bullet Train", "Amtrack", "Tram" };
        if (DropDownList1.SelectedValue == "Car")
        {
            DropDownList2.DataSource = CarArray;
        }
        else if (DropDownList1.SelectedValue == "Airplane")
        {
            DropDownList2.DataSource = AirplaneArray;
        }
        else
        {
            DropDownList2.DataSource = TrainArray;
        }
        DropDownList2.DataBind();
        DropDownList2.Visible = true;


为什么在改变DropDownList1的内容DropDownlist2的内容没有跟着变
搜索更多相关主题的帖子: Honda 737 void 
2012-03-21 09:13
yxhrgyj
Rank: 1
等 级:新手上路
帖 子:22
专家分:0
注 册:2012-2-5
收藏
得分:0 
解决了。。
2012-03-21 09:16
快速回复:DropDownList关联问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014229 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved