SelectedValue vs SelectedItem.Value of DropDownList

后端 未结 5 1768
猫巷女王i
猫巷女王i 2020-12-08 09:37

I\'m working on an old project written and then patched by several people over the years. At some places they have used SelectedValue property and other places they used Sel

5条回答
  •  遥遥无期
    2020-12-08 10:15

    In droupDown list there are two item add property.

    1) Text 2) value

    If you want to get text property then u use selecteditem.text

    and If you want to select value property then use selectedvalue property

    In your case i thing both value and text property are the same so no matter if u use selectedvalue or selecteditem.text

    If both are different then they give us different results

提交回复
热议问题