在.cs页面中访问HTML DropDownlist的值 [英] Access the Value of HTML DropDownlist in .cs page

查看:221
本文介绍了在.cs页面中访问HTML DropDownlist的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在.cs页面中获取HTML下拉列表的选定值

< select>< / select>

推荐答案

Do you using asp.net dropdown or html dropdown?
If you are using asp.net dropdown then dropdownname.selectedValue
If you are using html dropdown then you need to set value in any server side control on dropdown change and access that as you are access that control.


试试这一个





Try with this one


string  strSelectedValue=DropDown.selectedValue.ToString();


如果你的意思是下拉列表的选定值,那么..



If you mean the selected value of dropdownlist then..

YourDropDown.selectedValue





如果你的意思是选定的文字..





If you mean the selected text..

YourDropDown.SelectedItem.Text


这篇关于在.cs页面中访问HTML DropDownlist的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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