c# - MVC 4 @Html.DropDownListFor() not passing model values to dropdown -
i new mvc , trying test application feet wet. part of application generate form drop down box. use @html.dropdownlistfor() generate this, , on create form drop down works fine. when go edit form model value not passing drop down. selectlist item public static string[] onofflist() { var ret = new string[] { "on", "off" }; return ret; } form code @html.dropdownlistfor(model => model.servicecondition, new selectlist(onoffdropdownhelper.onofflist())) for instance assume model.servicecondition = "off". for reason whenever call form dropdown value "on", seems ignoring model value. i have tried this @html.dropdownlistfor(model => model.servicecondition, new selectlist(onoffdropdownhelper.onofflist(), "off")) to mandate "off" value, still coming "on" selected value in drop down. i reiterate, know model value "off", , created identical "create" for...