Get SelectedValue at SelectedIndex in DropDownList

2019-09-04 17:18发布

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条回答
SAY GOODBYE
2楼-- · 2019-09-04 17:47
TextBox.Text = DropDownList.SelectedValue;

Read more about ListControl.SelectedValue

查看更多
登录 后发表回答