MVC创建记录问题

时间:2011-02-25 19:18:13

标签: asp.net-mvc

 [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult Create([Bind(Exclude = "Id")] ContentPageNav contentToCreate)
        {
            DataClasses1DataContext dc = new DataClasses1DataContext();
            ContentPageNav content = contentToCreate;
            dc.SubmitChanges();
            return RedirectToAction("Index");
        } 

我错过了记录未插入的内容?

1 个答案:

答案 0 :(得分:0)

dc.ContentPageNavs.InsertOnSubmit(contentToCreate);