私は強く型付けされたモデルを持っています。
@model IPACS.Models.IPACS_Departments
このモデルにはdepartmentID, name, description, owner.
このモデルから DropDownList を設定する必要がありますが、方法がわかりません。
値をdepartmentID
、テキストを にしたいname
。
これが私が使用しているモデルです。
私のモデルは問題ですか?
public IPACS_Departments() { this.IPACS_Functions = new HashSet(); this.IPACS_Document = new HashSet(); }
[Key]public int departmentID { get; set; }
public string name { get; set; }
public string description { get; set; }
public string owner { get; set; }
public virtual ICollection<IPACS_Functions> IPACS_Functions { get; set; }
public virtual ICollection<IPACS_Document> IPACS_Document { get; set; }
以下の回答の構文を試しましたが、コンパイルされません。
私の model.departmentID、model.name、model.description、model.owner ここで何が欠けているのかわかりません。