Exemplo n.º 1
0
        public ActionResult MyCollection()
        {
            var oVm = new MyViewModel
            {
                CustomerName = "pop",
                hobbies = new List<Hobbies>
                {
                    new Hobbies {ID=1,Name="Foot ball",IsSelected=false},
                    new Hobbies {ID=2,Name="Table Tennis",IsSelected=false},
                    new Hobbies {ID=3,Name="Cricket",IsSelected=false},
                    new Hobbies {ID=4,Name="Web Surfing",IsSelected=false},
                    new Hobbies {ID=5,Name="Listening Music",IsSelected=false}
                },

                movies = new List<Movies>
                {
                    new Movies {ID=1,Name="Blood Sports",IsSelected=false},
                    new Movies {ID=2,Name="Good Kill",IsSelected=false},
                    new Movies {ID=3,Name="Avtar",IsSelected=false},
                    new Movies {ID=4,Name="Lost Africa",IsSelected=false},
                    new Movies {ID=5,Name="The Hell",IsSelected=false}
                }
            };

            return View(oVm);
        }
Exemplo n.º 2
0
 public ActionResult MyCollection(MyViewModel oVm, string CustomerName)
 {
     ViewBag.Message = "Success";
     return View(oVm);
 }