如何串联两个下拉菜单? [英] How to concate two dropdown?
本文介绍了如何串联两个下拉菜单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我花了两个dropdopdown年龄
这是我的恭喜
i take two dropdopdown for age
here is my concatnation
Convert.ToInt32(ddlAgeFrom.SelectedValue) + Convert.ToInt32(ddlAgeTo.SelectedValue)
我想像18到25一样存储在我的数据库中,我该怎么做
i want to store in my database like 18 to 25 how can i do that
推荐答案
试试这个
Try this
string ageRange = string.format("{0} to {1}", ddlAgeFrom.SelectedValue, ddlAgeTo.SelectedValue);
//push ageRange to DB now
您可以将两个字段之间用至"连接起来.
可以在ASP.Net或数据库级别上完成此操作,具体取决于您要在何处放置此逻辑.
You can concatenate the two fields with a "to" between them.
This can be done both at the ASP.Net or database level, depending on where you would want to place this logic.
这篇关于如何串联两个下拉菜单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文