aspx中
<select name = "country" >
<option value = "1" selcted> </option>
<option value = "2" > </option>
</select> 如何给select控件赋值,指定跳到特定值
现在我要在aspx.cs中通过C#代码,将string i="2"赋值给select
使它默认选中为 2,我该如何处理呢?
<select name = "country" >
<option value = "1" selcted> </option>
<option value = "2" > </option>
</select> 如何给select控件赋值,指定跳到特定值
现在我要在aspx.cs中通过C#代码,将string i="2"赋值给select
使它默认选中为 2,我该如何处理呢?
不是可以设置text属性吗?
你试试county.text=“2”
<option value = "1" selcted> </option>
<option value = "2" > </option>
</select>