예제 #1
0
        public ActionResult Index(int id = 1)
        {
            //This is where you could check if this is a mobile client and return a different view...
            if (Monkey(id))
            {
                var person = new Person
                    {
                        Id = id,
                        NameFirst = "Jim",
                        NameLast = "S",
                        DoB = new DateTime(2012, 1, 1),
                    };

                ViewBag.id = id;

                //this.ViewData["id"] = id;
                //ViewBag.Person = _person;
                var viewModel = new IndexViewModel
                    {
                        Person = person,
                        IsAdmin = true
                    };

                return View("index", viewModel);
            }
            return View("Login");
            //View(string arg) method just makes an actionresult with the name of the string passed in
        }
예제 #2
0
 public ActionResult Index(Person person)
 {
     _index++;
     return Index(_index);
 }