I am making a MVC 4 website that displays dynamic data. I have a search feature where they can enter an Id to a input box and only view the info pertaining to that Id. Well I would like to limit there searching capabilities by using a <select>
list so only valid options can be chosen.
This is the code I wrote:
<select>
@foreach (var item in Model)
{
<option value='@Html.ValueFor(modelItem => item.ResponseIdentifier)'></option>
}
</select>
I'm just trying to grab the Id and use it as the dropdown values in my select list. However, all i'm getting is empty space in the dropdown.
I'm new to web programming and not very familiar with MVC. I tried a couple other Methods to grab the into for the value, but none worked. If anyone has any tips that'd be great. Thank you Stack Overflowers! :)