如何使一个按钮完成许多任务 [英] how to make one button do many tasks

查看:99
本文介绍了如何使一个按钮完成许多任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使一个按钮执行许多任务

我制作了一个搜索表单,其中包含许多用户可以用来搜索的内容

其中一件事是按性别搜索,另一件事是通过SSN搜索

我为所有对象创建搜索按钮

所以我想知道如何做到这一点,但要根据用户选择的内容进行搜索.

how to make one button do many tasks

i make a search form that have many things that user can use to search

one of these things is search by gender and other is search by SSN

i make a search button for all

so i want to know how to make that but search according what the user had choose

推荐答案

显而易见的答案是,向事件处理程序中添加一些代码.但是,由于我们不知道有哪些可用的用户选择,因此很难提出任何明智的建议.也许您应该显示一个对话框,允许用户选择过滤器,位置,关键字,正则表达式等.
The obvious answer is, add some code to your event handler. However, since we don''t know what user choices are available it is difficult to make any sensible suggestions. Perhaps you should show a dialog which allows the user to select filters, locations, keywords, regexes etc.


在搜索"按钮的按钮单击事件处理程序中,您必须编写代码进行检查,在该控件中,用户提供了输入,然后将所有这些输入传递到存储过程,在该存储过程中您编写了查询以使用输入进行搜索...您也可以在存储过程中使用动态查询,但是要使用它,则必须正确验证输入在动态查询的情况下,sql注入的机会更大.
In button click eventhandler of "search" button, you have to write code to check, in which controls user has provided inputs and then pass all those inputs to stored procedure where you have written query to search with inputs... You can also use Dynamic Query in stored procedure but for using it but you have to validate your inputs properly as sql injection chances are more in case of dynamic query..


这篇关于如何使一个按钮完成许多任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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