如何创建搜索框? [英] How to create Search Box ?

查看:82
本文介绍了如何创建搜索框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在asp.net中创建搜索框编码,因为我想从网站本身搜索数据.......?

how to create searchbox coding in asp.net as i want to search data from the website itself.......?

推荐答案

您需要请先尝试.请执行以下步骤:
1.设计一个页面,在其中放置一些搜索参数.例如,在数据库中搜索名称,然后在文本框中搜索名称.
2.现在,放置一个搜索按钮作为搜索的触发事件.单击搜索按钮,您将在编写逻辑.
3.单击搜索按钮,获取搜索参数(如此处文本框中的名称),使用它,形成查询并在数据库上执行
4.将查询结果返回到数据表中,然后根据需要将其绑定到网格或任何其他适当的控件
5.现在,Datagrid将显示检索到的结果.

完成!
You need to try first. Follow these steps:
1. Design a page where you place few search parameters. For example, searching a name in DB, so a textbox for it.
2. Now, place a search button as the trigger event of the search. On click of search button you would be writing your logic.
3. In search button click, get the search parameters (like the name in textbox here), use it, form a query and execute on database
4. Get the query result back in a datatable and bind it to a grid or any other appropriate control based on your needs
5. For now, Datagrid will display the retrieved result.

Done!


这篇关于如何创建搜索框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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