モデルクラスのいくつかの属性のドロップダウンリストを生成したいと思います。私はmvc.netアプリケーションに取り組んでおり、ビューにかみそりエンジンを使用しています。これが私のクラスです:
public class present
{
public DateTime jour { get; set; }
public int entree_mat_h { get; set; }
public int entree_mid_h { get; set; }
public int sortie_mat_h { get; set; }
public int sortie_mid_h { get; set; }
public int entree_mat_m { get; set; }
public int entree_mid_m { get; set; }
public int sortie_mat_m { get; set; }
public int sortie_mid_m { get; set; }
public string mac { get; set; }
public string ip { get; set; }
}
たとえば、整数である属性ごとに0〜60の値を持つドロップダウンリストを表示したいとします。この場合、@ html.dropdownlistfor()は機能しますか?