在下拉列表的selectedindexchanged上获取价值 [英] get value on selectedindexchanged of dropdownlist

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

问题描述




我有一个dropdownlist的selectedindexchanged问题.我正在使用两个dropdownlist,想从数据库sqlserver中显示数据.所以,我想在第一个dropdownlist上的selectedindex的第二个dropdownlist上获取值,但它不起作用.我可以吗这是通过一个简单的javascript ???

请给我一个解决方案.

谢谢.




I have a problem of selectedindexchanged of a dropdownlist.I am using two dropdownlist and want to show data in them from database sqlserver.So,I want to get value on second dropdownlist on selectedindexchanged on first dropdownlist,but its not working.Can i do this by a simple javascript???

Please give Me a solution about this.

Thanks.

推荐答案

请按照以下步骤操作..

1)首先,您需要在第一个下拉菜单中添加一个属性
AutoPostback = true

2)现在,您需要设置第一次下拉菜单的selectedindexchange事件

3)在选定的索引更改事件编写器中,根据第一个dropdwon选定值或情况下的selecteditems.text
,为第二个dropdwon的数据binding编写代码
4)这样,您可以执行两个drop downs ...
Please follow this steps..

1) first of all you need to add one property to your first drop down
AutoPostback = true

2) now you need to set your selectedindexchange event of your first drop down

3) in selected index change event writer your code fro data binding for your second dropdwon as per the first dropdwon selected value or in-case selecteditems.text

4) this way you can perform your corresponding data binding of two drop downs...


这篇关于在下拉列表的selectedindexchanged上获取价值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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