Ejemplo n.º 1
0
        public IActionResult Index(CountryViewModel model)
        {
            if (ModelState.IsValid)
            {
                var msg = model.Country +  " selected";
                return RedirectToAction("IndexSuccess", new { message = msg});
            }

            // If we got this far, something failed; redisplay form.
            return View(model);
        }
Ejemplo n.º 2
0
 public IActionResult Index()
 {
     var model = new CountryViewModel();
     model.Country = "CA";
     return View(model);
 }
Ejemplo n.º 3
0
        public IActionResult IndexEmpty(CountryViewModel model)
        {
            if (ModelState.IsValid)
            {
                var msg = !System.String.IsNullOrEmpty(model.Country) ? model.Country
                    : "No slection";
                msg += " Selected";
                return RedirectToAction("IndexSuccess", new { message = msg });
            }

            return View(model);
        }