我有一些问题。 我刚刚创建的类名为学生,其具有的其他类对象,它是批处理的C#:如何使用对象填充DropDownList?
public class Student{
public Batch batch {get;set;}
public string Name{get;set;}
public string CNIC {get;set;}
}
,这里是批次类
public class Batch {
public string BatchName {get;set;}
public int BatchYear {get;set;}
}
和我创建了Student类的强类型视图现在怎么样我我应该显示与DropdownListFor方法助手与用户的批处理对象。 在此先感谢。
您无法将“
你是对的!我的错!这种情况下,你需要在你的模型中有一个“batchYear”,并将select与此绑定。 – 2015-04-01 11:09:33