How to pass the value to drop down fields in edit mode in MVC4?

后端 未结 3 1683
说谎
说谎 2021-01-27 03:04

Hi i have three Fields in my view.That three fields are drop down. I want to pass the value to these fields when edit button is clicked. That is the values need to pass to that

3条回答
  •  粉色の甜心
    2021-01-27 03:34

    use:

    @Html.DropDownListFor(model => model.EmployeeID,(IEnumerable)ViewData["EmployeeName"])
    

    The important part being "DropDownListFor". You are using "DropDownList".

提交回复
热议问题