1.html
<Asp:checkboxID= "CheckBox11"runat= "Server"onclick= "changechecked (this)" />Body Color:<asp:dropdownlistID= "DropDownList5"runat= "Server"> <Asp:listitemText= "Red"Value= "Red"Enabled= "true"Selected= "True"></Asp:listitem> <Asp:listitemText= "Green"Value= "Green" /> </asp:dropdownlist>
2.code
protected voidPage_Load (Objectsender, EventArgs e) { //text is usually used to display the foreground to the user.//value is typically used for form submissions, data submitted to the background stringL5_text = DropDownList5.SelectedItem.Text;//Red stringL5_value = DropDownList5.SelectedItem.Value;//Red. stringL5_value1 = DropDownList5.SelectedValue.ToString ();//Red. stringtext1= dropdownlist5.items[1]. Text;//Green stringvalue1 = dropdownlist5.items[1]. Value;//the Green BOOLIsSelected = dropdownlist5.items[1]. Selected;//the Green}
C#_ Control--dropdownlist