One: The select element of a predefined structure creates a combo box (ComboBox) value to fix the Write dead
<Selectclass= "Easyui-combobox"name= "State"style= "width:200px;"> <optionvalue= "AL">Alabama</option> <optionvalue= "AK">Alaska</option> <optionvalue= "AZ">Arizona</option> <optionvalue= "AR">Arkansas</option> <optionvalue= "CA">California</option> <optionvalue= "CO">Colorado</option> </Select>
:
Two: Creating a combo Box (ComboBox) dynamically loaded using JavaScript
<id= "CC" name= "Dept" value= "AA">
JS Code:
$ (' #cc '). ComboBox ({ ' test_list.aspx?id=1 ', ' id ', ' text ' });
C # backend Code:
protected voidPage_Load (Objectsender, EventArgs e) { if(request["ID"] =="1") { stringJosn ="[{ "+"\ "id\": 1,"+"\ "text\": \ "text1\""+"},{ "+"\ "id\": 2,"+"\ "text\": \ "Text2\""+"},{ "+"\ "id\": 3,"+"\ "text\": \ "text3\","+"\ "selected\": True"+"},{ "+"\ "id\": 4,"+"\ "text\": \ "Text4\""+"},{ "+"\ "Id\": 5,"+"\ "text\": \ "Text5\""+"}] "; Response.Clear (); Response.Write (JOSN); Response.End (); } }
:
Three: Create two dependent combo box (ComboBox) Linkage effects:
<inputID= "CC1"class= "Easyui-combobox"data-options= "Valuefield: ' id ', TextField: ' text ', url: ' test_list.aspx?id=1 ', Onselect:function (rec) {var url = ' Test_list.aspx?id= ' +rec.id; $ (' #cc2 '). ComboBox (' reload ', url); }"> <inputID= "CC2"class= "Easyui-combobox"data-options= "Valuefield: ' id ', TextField: ' Text '"></Div>
JS Get ComboBox Value
// Take ID$ (' #cc '). ComboBox (' GetValue '); // take the name$ (' #cc ') displayed. ComboBox (' GetText ');
. Net+easyui--combobox