如何根据asp.net中的Dropdownlist和textbox控件中的选择显示gridview数据? [英] how to display gridview data based on selection in Dropdownlist and textbox contol in asp.net?

查看:136
本文介绍了如何根据asp.net中的Dropdownlist和textbox控件中的选择显示gridview数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里我要求根据下拉列表和文本框控件中的选择显示Gridview控件



例如,如果我有类似< =或>的内容=如果我根据条件输入10000或20000,如果用户选择< =(下拉列表)10000(文本框),则应该在Gridview中显示适合的薪水,则下拉列表和文本框中的运算符。怎么做?请给我一些展望。



谢谢和问候

rax227

here i have a requirement to display Gridview control based on the selection from dropdownlist and textbox control

for instance if i have something like <= or >= operators in dropdownlist and in textbox if i enter 10000 or 20000 based on the condition like if the user selects <=(dropdown) 10000(textbox) the salary which suits should be displayed in the Gridview. how to do it? some one give some outlook on that please.

Thanks & Regards
rax227

推荐答案

您只需要使用选择进行查询。就是这样。



当用户选择下拉列表时,获取SelectedValue并从TextBox中获取Text。然后相应地形成您的查询并使用ADO.NET在数据库上执行。接下来获取结果数据集并绑定到GridView。
You just need to make the query with the selections. That's it.

When user selects the dropdownlist, get the SelectedValue and from TextBox get the Text. Then form your query accordingly and execute on database with ADO.NET. Next get the resultant dataset and bind to the GridView.


这篇关于如何根据asp.net中的Dropdownlist和textbox控件中的选择显示gridview数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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