Click here to Skip to main content
15,889,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How to get the selected value of HTML dropdownlist in .cs page
<select></select>
Posted
Comments
creepz03 11-Dec-13 3:24am    
Could you post you code?
Karthik_Mahalingam 11-Dec-13 5:38am    
pls add more info..

SQL
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.
 
Share this answer
 
Try with this one


C#
string  strSelectedValue=DropDown.selectedValue.ToString();
 
Share this answer
 
v2
If you mean the selected value of dropdownlist then..

C#
YourDropDown.selectedValue


If you mean the selected text..

C#
YourDropDown.SelectedItem.Text
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900