就是图片随着下拉列表的值的变化而变化,详细点哈,最好有代码,多谢了呀……

解决方案 »

  1.   

    http://www.codeproject.com/KB/custom-controls/combobox_dropdownlist_img.aspx
      

  2.   

    在下拉列表的changeSelecting事件中获取下拉列表的当前选中的值,
    根据值来给IMAGE控件绑定图片!
      

  3.   

    最开始的时候下拉列表里是没有值的,当页面加载的时候通过FOR循环把图片的名称加进去的
    if (!IsPostBack)
            {
                for (int i = 1; i <= 10; i++)
                {
                    this.ddlPic.Items.Add("pic" + i.ToString() + ".gif");            }
             }
    我这样写的  后面再怎么写呢
      

  4.   

    前台
    <asp:Image ID="Image1" runat="server" Height="200px" />
            <asp:DropDownList ID="DropDownList1" runat="server" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" AutoPostBack="True">
                <asp:ListItem Value="0" Selected="True">第一张</asp:ListItem>
                <asp:ListItem Value="1">第二张</asp:ListItem>
                <asp:ListItem Value="2">第三张</asp:ListItem>
                <asp:ListItem Value="3">第四张</asp:ListItem>
                <asp:ListItem Value="4">第五张</asp:ListItem>
            </asp:DropDownList>后台
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (Convert.ToInt32(DropDownList1.SelectedValue))
            {
                case 0:
                    Image1.ImageUrl = "image/0.jpg";
                    break;
                case 1:
                    Image1.ImageUrl = "image/1.jpg";
                    break;
                case 2:
                    Image1.ImageUrl = "image/2.jpg";
                    break;
                case 3:
                    Image1.ImageUrl = "image/3.jpg";
                    break;
                case 4:
                    Image1.ImageUrl = "image/4.jpg";
                    break;
                default:
                    Image1.ImageUrl = "image/0.jpg";
                    break;
     
            }
    这是我做的,很简单,不晓得是不是你要的效果,呵呵