在我的MVC应用程序中,我尝试使用存储过程检索数据,然后将其显示在下拉列表中。 这里是我的控制器动作 public ActionResult Register(string id)
{
RegistrationModel Student = new RegistrationModel();
using (var db = new StudentEntities())
我已阅读MVC的多次专家说,如果我使用的SelectList,这是最好的在我的模型中定义IEnumerable<SelectList>。 例如,在这个question。 考虑一个简单的例子: public class Car()
{
public string MyBrand { get; set; }
public IEnumerable<SelectListItem> C