两个下拉列表分别选择一种效果 [英] Two dropdownlist seleting one effect other

查看:73
本文介绍了两个下拉列表分别选择一种效果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我选择一个DropDownList,我如何像在学生桌中那样影响其他人.
一个DropDownList表示ID,如果选择了其他ID,则表示其他名称,然后会自动选择名称.

If I select one DropDownList how can I effect others like in table student.
One DropDownList for id and other name if selected id then automatically get selected of name.

推荐答案

^ ]解决方案应该最适合您(使用AJAX).

[此处 [ ^ ]是完成此任务的好视频.
This cascading dropdown[^] solution should be ideal for you (using AJAX).

This[^] is another good link.

Here[^] is a good video for this task.


您可以添加以下方法...

为第一个下拉列表编写一个OnSelectedIndexChanged方法.在该事件上,将要绑定的值与第二个dropdownlist绑定.

问候,
Sagar
you can add following method...

write an OnSelectedIndexChanged method for first dropdownlist. On that event bind the values that you want to bind with 2nd dropdownlist.

Regards,
Sagar


Dropdown1Autopostback 属性设置为true
并在dropdown1onselectedindexchanged事件中编写代码以从数据库检索记录并将其绑定到dropdown2
Set Autopostback property of Dropdown1 to true
and in onselectedindexchanged event of dropdown1 write code to retrieve records from database and bind them to dropdown2


这篇关于两个下拉列表分别选择一种效果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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