根据在多个下拉列表中选择的值和单击按钮时的文本框形成查询字符串 [英] Forming a query string based on the values selected in multiple dropdowns and a textbox on button click

查看:112
本文介绍了根据在多个下拉列表中选择的值和单击按钮时的文本框形成查询字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
有人可以告诉我如何
单击按钮后,将根据(MVC3)Razor中的多个下拉列表和文本框中选择的值来形成查询字符串.

实际上,我有四个下拉菜单,分别是国家/地区",城市",类别",子类别"和一个文本框.现在我想将这些值从一个视图传递到mvc(3)Razor中的另一个控制器.
谢谢
naveen sharma

hi all,
can some one tell me how to
Forming a query string based on the values selected in multiple dropdowns and textbox in (MVC3) Razor on button click.

actually i have four dropdown respectively Country,City,Category,SubCategory and one textbox. now i want to pass these values from one view to other controller in mvc(3) Razor.
thanks
naveen sharma

推荐答案

作为经验法则,您不应根据此数据构成查询,而应创建一个或多个参数化查询并在已经存在的参数中替换参数命令.具体的机制取决于您使用的数据库提供程序,它可以是位置的或命名的.您没有分享使用的提供商,所以我不想在所有可能的情况下提供您的示例.

—SA
As a rule of thumb, you should not form a query out of this data, you should create one or more parametrized queries and substitute parameters in already existing commands. A concrete mechanism depends on database provider you use, it could be either positional or named. You did not share what provider do you use, so I don''t want to give your examples for all possible cases.

—SA


这篇关于根据在多个下拉列表中选择的值和单击按钮时的文本框形成查询字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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