I have a drop down list that is generated and used by @Html.EditorFor in an ASP.net page, my issue is I am unable to assign an Id to this field. I have the same control which i am using in 2 different spots and i want to use the index/id from my model to switch/swap the values.here is the dic for it
<div class="editor-field">
@Html.EditorFor(m => m.state, new { @id = "state" + Model.Index })
</div>
the html rendered is
<div class="editor-field">
<label for="EteProvince">State</label>
<select id= "EteProvince" name="EteProvince" style="width:220px"
class="valid">
</select>
</div>
i want to add a model.index to the id of select. Is there a way to do this?
Thanks