Hope this helps
Step1. In your HTML
<form id="Form1" method="post" runat="server">
<asp:Button id="Button1" runat="server" Text="Button"></asp:Button>
<SELECT id="Select1" runat="server">
<OPTION SELECTED>Item1</OPTION>
<OPTION>Item2</OPTION>
<OPTION>Item3</OPTION>
</SELECT>
</form>
Step2. In your Code behind
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Button Button1;
protected System.Web.UI.HtmlControls.HtmlSelect Select1;
private void Button1_Click(object sender, System.EventArgs e) {
Response.Write(Select1.Value);
}
}
==================================
What you are looking at is:
==================================
1. Step1 make your HTML dropdown runat="server" and give it an ID (Select1 in this case)
2. Declare a variable with the same name as the ID and Type System.Web.UI.HtmlControls.HtmlSelect
Finally, access the HTML control as Select11.Value ! :)