In this article I will explain how to get the selected value of HTML Select DropDownList in ASP.Net code behind using C# and VB.Net.
There are two ways we can access the HTML Select DropDownList selected value in ASP.Net code behind
1. Using Request Form collection and name property.
2. Using runat = “server” property.
 
HTML Markup
The HTML Markup consists of a Form consisting of two HTML Select DropDownLists and a Button of which one DropDownList uses name property while other uses runat = “server” property.
<form id="form1" runat="server">
    Select Fruit:
    <select id="ddlFruits" name="Fruit">
        <option value=""></option>
        <option value="Apple">Apple</option>
        <option value="Mango">Mango</option>
        <option value="Orange">Orange</option>
    </select>
    <br />
    Select Color:
    <select id="ddlColors" runat="server">
        <option value=""></option>
        <option value="Red">Red</option>
        <option value="Yellow">Yellow</option>
        <option value="Orange">Orange</option>
    </select>
    <br />
    <br />
    <asp:Button Text="Submit" runat="server" OnClick="Submit" />
</form>
 
 
Get selected value of HTML Select DropDownList in ASP.Net code behind
Following is the Button Click event handler inside which values of both the HTML Select DropDownLists are being accessed.
The value of the Fruit DropDownList is being fetched using its name and the Request.Form collection and the value of the Color DropDownList is fetched directly using the Value property.
C#
protected void Submit(object sender, EventArgs e)
{
    string fruit = Request.Form["Fruit"];
    string color = ddlColors.Value;
}
 
VB.Net
Protected Sub Submit(sender As Object, e As EventArgs)
    Dim fruit As String = Request.Form("Fruit")
    Dim color As String = ddlColors.Value
End Sub
 
The following screenshot displays the values of both the DropDownLists being fetched.
Get selected value of HTML Select DropDownList in ASP.Net code behind using C# and VB.Net
 
 
Demo
 
Downloads