在DropDownList中的SelectedIndex处获取SelectedValue? [英] Get SelectedValue at SelectedIndex in DropDownList?

查看:180
本文介绍了在DropDownList中的SelectedIndex处获取SelectedValue?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能吗?当使用以下代码触发特定事件时,我会以编程方式更改所选索引:

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

DropDownList.SelectedIndex = DropDownList.SelectedIndex + 1

现在,我想通过回发,使用DropDownList的新SelectedIndex中的文本更新相应的文本框.

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

最简单的方法是什么?

我知道我该如何使用javascript....我只是想知道我是否可以在后面的VB代码中做到这一点.

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

推荐答案

TextBox.Text = DropDownList.SelectedValue;

详细了解 ListControl.SelectedValue

这篇关于在DropDownList中的SelectedIndex处获取SelectedValue?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆