2013-0725

在asp.net mvc的强类型视图(strongly typed view)使用下拉列表,在Controller中设定的选择项在View上选中失效


下面是我的代码:

public ActionResult Create(int id=0,int parentid=0)
{
    var productCategory=db.ProductCategorys.Where(pc => pc.ParentID == parentid).ToList();
    productCategory.Insert(0,new ProductCategoryModel() { Name = "顶级分 阅读全文>>
                
标签: ASP.NET MVC SelectList selected 阅读:11079