DropDownList1.items(DropDownList1.selectindex).text

解决方案 »

  1.   


      To xinyu_1980(心雨):
        
        你说的:DropDownList1.items(DropDownList1.selectindex).text仍然返回的是string 类型的呀。而我要的是int 类型的值!
      

  2.   

    类型转换呀
    System.Convert.ToInt32(DropDownList1.items(DropDownList1.selectindex).text)
    把string转换成int就可以使用了。
      

  3.   

    int.Parse(DropDownList1.SelectedItem.Value)
      

  4.   

    System.Convert.ToInt32(DropDownList1.SelectedItems.Text)