请问各位,如何在下拉菜单中设立初始值呢? 初始选定头像1:<asp:listitem value="m04" Selected="True">头像1</asp:listitem> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 初始选定头像1: <asp:listitem value="m04" Selected="True">头像1</asp:listitem> 这样我也试过了!不行。我的要求是通过<p align="center"><img border="0" src="face/<%# ListBox_face.selectedItem.Value %>.gif" 这一句来显示出图片,但是一开始怎么也获取不到初始值,该如何设呢?? 把<img做成一个RunAtServer的控件,然后在代码里指定其src。 试试<asp:listitem value="m04" selected="ture" >头像1</asp:listitem> icyer能不能给个例子呢!感谢! 修改这一句:<img border="0" src="face/<%# ListBox_face.selectedItem.Value %>.gif">改为:<img src='' runat="server" id="img1" border="0">然后在代码中这样给控件赋值:img1.Src=Server.MapPath("ciba1b.bmp"); 哦,你别看错了!HTML中的src后面不是引号,而是两个单引号。当然,也可以是两个引号或者干脆不写src。 通过服务器端, 用dropdownlist.selectedindex = dropdownlist.items.indexof(new listitem("string1"));但string1 要在dropdownlist中包含 用dropdownlist.selectedindex = dropdownlist.items.indexof(new listitem("string1"),index); 应该这样dropdownlist.selectedindex = dropdownlist.items.indexof(new listitem("string1",index)); 大侠帮我分析一下这个网站,我想用到里面的DoAction函数 关于IE8的一个session问题。 Literal控件 一个数据库设计上的问题,了解的请进来一下 网站打不开,错误代码如下 请高手指点一下原因 CodeSmith for Nhibernate的问题:它是如何实现NHibernate.cst这个模板文件中引用NHibernate.class.cst这个模板中的代码的? webpart 乱码 请问创建文件夹的代码怎么写啊? 从来没有费这么大的力气研究一个控件! 这么修改vs2010自带的编辑界面 简单问题,赶快来!! 关于在.aspx页面中的弹出新窗的又一问题
<asp:listitem value="m04" Selected="True">头像1</asp:listitem> 这样我也试过了!不行。
我的要求是通过
<p align="center"><img border="0" src="face/<%# ListBox_face.selectedItem.Value %>.gif"
这一句来显示出图片,但是一开始怎么也获取不到初始值,该如何设呢??
<asp:listitem value="m04" selected="ture" >头像1</asp:listitem>
<img border="0" src="face/<%# ListBox_face.selectedItem.Value %>.gif">
改为:
<img src='' runat="server" id="img1" border="0">
然后在代码中这样给控件赋值:
img1.Src=Server.MapPath("ciba1b.bmp");
HTML中的src后面不是引号,而是两个单引号。当然,也可以是两个引号或者干脆不写src。
dropdownlist.selectedindex = dropdownlist.items.indexof(new listitem("string1"));
但string1 要在dropdownlist中包含