Could you help me how to send selected option’s parameter to controller? Here is my view:
<select>
@foreach(var item in Model.City)
{
<option>@Html.DisplayFor(x => item.Name)</option>
}
</select>
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
so, in your view you would have something like:
in your controller, all you have to do is have an action with the same name, but with a different signature:
either:
or you can pass the entire Model
but with such question, I would suggest you to spend some time with the free ASP.NET Course from PluralSight that you can find in the ASP.NET oficial website:
Free available courses:
courses are in the right sidebar of each page
And from Scott Hanselman: