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. is there a standard way to inject the ids into a partial view ?
right now i am doing things like this:
<% Html.RenderPartial("ExerciseList", Model); %>
<% Html.RenderPartial("ExerciseList2", Model); %>
where ExerciseList and ExerciseList2 are identical but with different ids but i am sure there is a better way.