DropDown列表AsP.net [英] DropDown List AsP.net

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

问题描述

你好,



-我在asp.net中有2个下拉列表。一个包含S.no,另一个包含名称。存储在SQL Server中。



- 我只想在第一个下拉列表中选择s.no时自动选择in中的名称第二个下拉列表..已存储在SQL Server中



-SQL表字段包含



S.NO |姓名| fName



谢谢,

xibit89

解决方案

< blockquote> 逻辑



  1. 使用 OnSelectedIndexChanged方法 [ ^ ] DropDownList
  2. 获取选定值
  3. 循环遍历 DataTable 并找到它所在的行已选择值(S.No)
  4. 获取所需的列值(该行中 DropDown 值,需要选择)。
  5. 选择其他 DropDown 按我们在上一步中获得的值。


Hello,

-I have 2 drop down lists in asp.net. one contain S.no and the other one contains the name. that are stored in SQL Server.

-I just want to that when I select the s.no from the 1st drop down list it automatically selects the name in the in the 2nd drop down list.. which is already stored in SQL Server

-SQL Table fields contains

S.NO|Name|fName

Thanks,
xibit89

解决方案

Logic


  1. Use OnSelectedIndexChanged Method[^] of DropDownList.
  2. Get the Selected Value.
  3. Loop through the DataTable and find the Row where it has that Selected Value (S.No).
  4. Get required column value (the DropDown value, which need to be selected) in that Row.
  5. Select other DropDown by the value we got in previous step.


这篇关于DropDown列表AsP.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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