在asp.net中使用dropdownlist显示图像 [英] displaying images using dropdownlist in asp.net

查看:275
本文介绍了在asp.net中使用dropdownlist显示图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用asp.net中的下拉列表显示图像

displaying images using dropdownlist in asp.net

推荐答案

您的意思是什么?

您是否正在寻找一个可以在其中显示图像的下拉菜单?

如果是这样,则无法使用Normal Select进行此操作,您需要使用Javascript来实现自己,就像在此处一样. [^ ]

:cool:
What do you mean ?

Are you looking for a dropdown that will show images in it ?

If this is so, you cant do this using Normal Select, you need to make that yourself using Javascript just like here.[^]

:cool:


以图片的方式说"Image1",以下拉的方式说"DropDown1",绑定下拉菜单,并将"DataTextField"设置为图像名称,将"DataValueField"设置为图片的路径.将下拉菜单的AutoPostBack属性设置为true并分配以下代码
在下拉的selectedindexchange事件上

Image1.ImageUrl = DropDown1.SelectedValue.ToString();
Take an image let say "Image1",Take a drop down let say "DropDown1",Bind dropdown and set "DataTextField" as Name of the image and "DataValueField" as Path of the image.Set AutoPostBack property of drop down to true and assign following code
on selectedindexchange event of dropdown

Image1.ImageUrl=DropDown1.SelectedValue.ToString();


这篇关于在asp.net中使用dropdownlist显示图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆