I've got a problem with getting out the selected value in my DropDownList
.
In my ViewModel
I created a list
public SelectList movies;
and populated it in GET method with the following values
foreach (Movies m in db.Movies)
{
movies.Add(new SelectListItem { Text = m.Title, Value = m.IdMovies.ToString() });
}
And displayed it like:
@Html.DropDownListFor(m => m.IdMovies, Model.movies, "--Select Movie--")`
How can I get the selected value in my POST
method?