私はMVCを実行しており、ドロップダウンリストにルックアップ値があります。UpdateModelを呼び出す場合、ルックアップが更新される前の値のみを呼び出し、その後は何も呼び出しません。エラーは発生しません。
コントローラで次のコードを編集、作成、使用できます。
ViewData["SiteMaintenanceId"] = from m in this._siteRepository.FindAllSiteMaintenances().ToList()
select new SelectListItem
{
Text = m.Maintenance,
Value = m.SiteMaintenanceId.ToString(),
Selected = (m.SiteMaintenanceId == site.SiteMaintenanceId)
};
return View(new SiteFormViewModel(site,
this._siteRepository.FindAllSiteOperators()));
私の見解では、次のようになっています。
<%= Html.DropDownList("SiteOperatorId")%>
これは問題なくバインドされているようで、ドロップダウンの編集で選択した値を取得して作品を作成できます。
MVCを実行するのはこれが初めてなので、助けていただければ幸いです。