后台如何控制前台select的选中项
假如我前台有一个
<select id= "ddl ">
<option value= "111 "> aaa </option>
<option value= "222 "> bbb </option>
<option value= "333 "> ccc </option>
</select>
我在后台如何改变它的选中项?
就假如我要在Page_Load()方法里设置它的选中项为第2项
protected void Page_Load(object sender, EventArgs e)
{
}
------解决方案-------------------- <select id= "ddl " runat= "server ">
<option value= "111 "> aaa </option>
<option value= "222 "> bbb </option>
<option value= "333 "> ccc </option>
</select>
----------------------------
protected void Page_Load(object sender, EventArgs e)
{
ddl.Value = "222 "; //使得bbb选中
}