国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項超值服

開通VIP
SelectedValue與SelectedItem.Value的區(qū)別
public virtual ListItem SelectedItem {    get {        int selectedIndex = this.SelectedIndex;        if (selectedIndex >= 0) {            return this.Items[selectedIndex];        }        return null;    }}public virtual string SelectedValue {    get {        int selectedIndex = this.SelectedIndex;        if (selectedIndex >= 0) {            return this.Items[selectedIndex].Value;        }        return string.Empty;    }}

在沒有選定任何項的情況下,SelectedValue默認(rèn)值是string.Empty,而SelectedItem默認(rèn)值是null(也就是說通過SelectedItem.Value可能發(fā)生異常)因此需要設(shè)定默認(rèn)值:添加items.add("未選定",0,) 避免異常??!

1. selectedIndex——指的是dropdownlist中選項的索引,為int,從0開始,可讀可寫

2. selectedItem——指的是選中的dropdownlist中選項,為ListItem,只讀不寫

3. selectedValue——指的是選中的dropdownlist中選項的值,為string, 只讀不寫

4. selectedItem.Text——指的是選中的dropdownlist中選項的文本內(nèi)容,與selectedItems的值一樣為string,可讀可寫

5. selectedItem.value——指的是選中的dropdownlist中選項的值,與selectedValue的值一樣,為string,可讀可寫

光看文字可能不太理解,我也是通過程序來加深理解的,下面舉個例子:

本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊舉報。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
用多個DropDownList分別來綁定多個年月日
DropDownList和ListBox下拉列表學(xué)習(xí)
listbox控件的一些操作
comboBox.SelectedItem與SelectedText區(qū)別
.net根據(jù)確定下拉框中的選中項
flex DropDownList 的使用
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服