Beispiel #1
0
        public ActionResult Index(SampleVM data)
        {
            var aa = new SampleVM() { name = "aaa", title = "aaa" };
            ViewData["Name"] = "John";

            ViewData["ListItem"] = new SelectList(db.Occupation.ToList(), "OccupationId", "OccupationName");

            return View();
        }
 public ActionResult Index(SampleVM data)
 {
     if(ModelState.IsValid)
     {
         TempData["msg"] = "新增" + data.Name + "成功!";
         return RedirectToAction("IndexResult");
     }
         return View();
 }