これは私のViewModelMVC:viewmodelでドロップダウンリストにデータを表示するには、データベースからデータを取得するにはどうすればいいですか?
public class IndexViewModel
{
public string QuestionText { get; set; }
public string Sname { get; set; }
public string Cname { get; set; }
public int CID { get; set; }
public int SID { get; set; }
public Question question { get; set; }
public CoreValue corevalue { get; set; }
public SubjectType subjecttype { get; set; }
}
で、私のビュー内で、私はこのコードAINTの作業に問題がある:
@model NKI3.ViewModels.IndexViewModel
@using (Html.BeginForm()) {
<fieldset>
<div class="editor-label">
@Html.DropDownListFor(model => model.Sname)
</div>
</fieldset>
}
私が取得エラーメッセージは、「メソッドの何オーバーロードは「DropDownListForは1つの引数をとらない」され
解決策は何ですか?
ありがとうございます!