DropDownList 常會事前先寫入值
再經由資料庫撈值放到相對應的位置
若DropDownList沒值就會發生錯誤
在網路上找了許久,才寫出答案...

Me.DropDownList.DataBind()
DropDownList.SelectedIndex = DropDownList.Items.IndexOf(DropDownList.Items.FindByValue("值"))


arrow
arrow
    全站熱搜

    Roger 發表在 痞客邦 留言(0) 人氣()