コード例 #1
0
        public ActionResult ComplexForm()
        {
            //NOTE: this would normally be a call to the database.
            Person model = new Person
            {
                FirstName = "Joe",
                Email = "*****@*****.**",
                Template = new School{ IsTemplate = true },
                Friend = new Person{FirstName = "Bob", Email = "*****@*****.**"},
                SchoolsIWentTo = new List<School> { 
                    new School {Name = "Some college", PhoneNumber = "123.123.1234", IsTemplate = false}
                }
            };

            return View(model);
        }
コード例 #2
0
 public ActionResult ComplexForm(Person model)
 {
     return View(model);
 }