Get SelectedValue at SelectedIndex in DropDownList?

别来无恙 提交于 2019-12-13 20:39:25

问题


Is this possible? I programatically change the selected index when a certain event is fired using this code:

DropDownList.SelectedIndex = DropDownList.SelectedIndex + 1

Now I want to update a corresponding textbox with the text that is in the new SelectedIndex of the DropDownList via postback.

What's the easiest way to do this?


I know how I can do this in javascript.... I was just wondering if i could do this in the VB code behind.


回答1:


TextBox.Text = DropDownList.SelectedValue;

Read more about ListControl.SelectedValue



来源:https://stackoverflow.com/questions/4399690/get-selectedvalue-at-selectedindex-in-dropdownlist

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!