如何将下拉值传递给url地址 [英] How to pass dropdown value to url address

查看:77
本文介绍了如何将下拉值传递给url地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将用一个例子解释我的情景。



我的网页是用于例如。 sample.com/Statistics.aspx/?country=



我有一个下拉列表,我可以在这里更改国家/地区。如果我选择INDIA那么我应该这样显示



sample.com/Statistics.aspx/?country=INDIA



如何操作???



提前致谢。



问候,

Naveen

解决方案

if(Request.QueryString [country]!= null)

{

LoadData(Request.QueryString [country]。tostring());

}


使用jQuery你可以获取下面的选定文本

 


< span class =code-string>#yourdowndownid选项:选中)。text();





样本的.com / Statistics.aspx /?国家=+


I will explain my scenario with an example.

my webpage is for eg. sample.com/Statistics.aspx/?country=

i have a dropdown list where i can change the countries. If for eg i select "INDIA" then i should display as such

sample.com/Statistics.aspx/?country=INDIA

How to do this???

Thanks in advance.

Regards,
Naveen

解决方案

if(Request.QueryString["country"]!=null)
{
LoadData(Request.QueryString["country"].tostring());
}


Using jQuery you can get the selected text lke below


("#yourdropdownid option:selected").text();



"sample.com/Statistics.aspx/?country="+


这篇关于如何将下拉值传递给url地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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