我有这个下拉列表,如下所示,我想根据可用数据预先选择一个项目。但它不起作用。始终选择最后一个选项。
<select id = @ids>
<option value="0" @item.SchoolType == " " ? selected ></option>
<option value="1" @item.SchoolType == "Primary School" ? selected>Primary School</option>
<option value="2" @item.SchoolType == "Middle School" ? selected>Middle School</option>
<option value="3" @item.SchoolType == "High School" ? selected>High School</option>
<option value="4" @item.SchoolType == "University" ? selected>University</option>
</select>
如何解决这个问题。
谢谢
RJ