如何在服务器端获取客户端绑定下拉值(c#) [英] how to get client side binded drop-down value in server side(c#)
本文介绍了如何在服务器端获取客户端绑定下拉值(c#)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
使用jquery绑定下拉列表。
供您参考 Request.Form [dropDist.UniqueID] 使用此我们可以在下拉列表中选择值。但是有没有任何棘手的方法可以在c#中选择下拉列表文本。
解决方案
尝试制作如下客户端代码
< asp:listitem value = 印度 text = India xmlns:asp = #unknown >< / asp:listitem > (静态在这里)或(/你可以用数据库值绑定它。)
在COde中:
< pre lang =c#> Idofdropdown.SelectedItem.Text;
Hi all,
Am binding a dropdown list using jquery.
For your reference Request.Form[dropDist.UniqueID] Using this we can get selected value of dropdown list.but is there any tricky way to get dropdown selected text in c#.
解决方案
try to make your clientside code like below
<asp:listitem value="India" text="India" xmlns:asp="#unknown"></asp:listitem>(static here)or(/You can bind it with database values.)
In COde:
Idofdropdown.SelectedItem.Text;
这篇关于如何在服务器端获取客户端绑定下拉值(c#)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文