public ActionResult PersonModelBinding(Person person) { //ViewData.Model = person; //return View(); return View(person); // 使用Create範本 // return View("CreatePersonModelBinding", person); }
public ActionResult MultiPersonModelBinding(Person man, Person woman) { ViewBag.ManName = man.Name; ViewBag.ManAge = man.Age; ViewBag.WomanName = woman.Name; ViewBag.WomanAge = woman.Age; return View(); }
public ActionResult DemoJson1() { Person person = new Person { Name = "Bruce", Age = 18 }; return Json(person, JsonRequestBehavior.AllowGet); }