0
이 선택이 있고 DropDownlistFor 호출로 변환해야합니다.변환 대상 선택 DropDownListFor MVC 5
사람이 도와 줄 수 : 여기
<select class="form-control" name="QuestionBasicSection.Questions[@counter].ANSWER_LOOKUP_OPTION_ID" id="@selectId">
@foreach (var x in questionBasicSection.Questions[j].LookupGroup)
{
<option value="@x.Value" selected="@x.Selected">@x.Text</option>
}
</select>
이 골격이다, 난 그냥 모르겠어요 설정하는 방법 selectList의와 소스를 제공함으로써 작동 DropDownListFor 선택한 값
@Html.DropDownListFor(q => questionBasicSection.Questions[@counter].ANSWER_LOOKUP_OPTION_ID,
new SelectList(
new List<Object>{
new { value = 0 , text = "Red" },
new { value = 1 , text = "Blue" },
new { value = 2 , text = "Green"}
},
"value",
"text",
// Not sure how to set selected
)