日期:2014-05-19  浏览次数:20419 次

高手指点DropDownList控件?
ASP.NET里的DropDownList控件的集合中的每一项不是有2个值吗?一个TEXT,一个VALUE,取VALUE可以这样取值DropDownList1.SelectedValue      
我想请问下,取TEXT的值怎么取,
在就是请指导在后台代码怎么取,
在前台JavaScript里怎么取这两个的值,请依次说明。给出相关代码,谢谢!

------解决方案--------------------
javascript:
var list=document.getElementById( "DropDownList1 "); //DropDownList的ID号
var listindex=list.selectedIndex; //DropDownList中选中项的索引号
var v=list.options[listindex].value; //v等于DropDownList中选中项的value
var t=list.options[listindex].text;