I'm trying to develop an application using ASP.Net MVC 5 & Entity Framework 6. I'm getting confused with Html helpers.
I have a Driver
,Vehicle
Entities. When i entering a new driver, there is a select box to select and assign a vehicle to the new driver.
All vehicle RegNo properties should be loaded to the @Html.DropDownListFor() when page loading. And when submitting the page, the ID of the selected vehicle should be inserted to the VehicleID column in Driver
entity.
This is the UI of Driver
view.
This is my Entity
user select the RegNo of the Vehicle in @Html.DropDownListFor()
and the ID of the vehicleshoud be submitted to the Entity when submitting the form.
How to do this in runtime?
Thanks in advance.