how do you reuse a partial view with different ids
- by oo
i have a partial view with a dropdown in it. the code looks like this:
<%=Html.DropDownListFor(x => Model.Exercises, new SelectList(Model.Exercises, "Id", "Name", Model.SelectedExercise), new { @id = "exerciseDropdown", @class = "autoComplete" })%>
the issue is that i want to reuse this partial view in multiple places but i want to have a different id assigned to the control (instead of exerciseDropdown always) but on the outside i only have this . .
<% Html.RenderPartial("ExerciseList", Model); %>
is there anyway to pass in an id into a partial view. should i stick this into my view model as a seperate property "Model.ExerciseDropdown2" for example.
is there a better way ?