HTML Control: get value from select (ComboBox) (C#) : ComboBox « HTML Control « ASP.Net






HTML Control: get value from select (ComboBox) (C#)

<%@Page Language="C#" %>
<html><body>
  <form runat=server>
    <h3>Enter name: <input name="_name" id='_name' runat=server type=text/>
        
    Personality: <select runat=server name="_personality" id='_personality'>
      <option>extraverted</option>
      <option>introverted</option>
      <option>in-between</option>
    </select>
    <input type=submit name="_lookup" value="Submit"></input>
    <p>
    <%
      if (IsPostBack)
        Response.Output.Write("Hi {0}, you selected {1}",
              _name.Value, _personality.Value);
    %>
    </p>  </form></body></html>


           
       








Related examples in the same category

1.ComboBox(HTML Input Radio Button): get selected value (VB.net)