Пример #1
0
        public ActionResult CascadingDropDownTest()
        {
            var model = new CascadingDropdownsModel
            {
                Countries =
                    new List <SelectListItem>
                {
                    new SelectListItem
                    {
                        Text  = "US",
                        Value = "US"
                    },
                    new SelectListItem
                    {
                        Text  = "UK",
                        Value = "UK"
                    },
                },
                SelectedCountry = "US",
                SelectedCity    = "New York",
                //SelectedStreet = 2
            };

            return(View(model));
        }
Пример #2
0
 public ActionResult CascadingDropDownTest(CascadingDropdownsModel model)
 {
     if (!ModelState.IsValid)
     {
         return(this.View(model));
     }
     return(RedirectToAction("CascadingDropDownTest"));
 }