using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using WebApplication10.Models; namespace WebApplication10.Controllers { public class userdataController : Controller { // GET: userdata public ActionResult userdata() { userdata model = new userdata { model.environmentlist = new List<string> { "w1", "w2", "w3", "w4" }; }; return View(model); } [HttpPost] public ActionResult userdata(userdata model) { if (string.IsNullOrEmpty(model.unumber)) { model.ValidationMsg = "Please enter unumber"; } else { switch (model.envoption) { case "w1": switch(model.regionoption) { case "us1": break; case "us2": break; case "us3": break; } break; case "w2": switch (model.regionoption) { case "us1": break; case "us2": break; case "us3": break; } break; case "w3": switch (model.regionoption) { case "us1": break; case "us2": break; case "us3": break; } break; case "w4": switch (model.regionoption) { case "us1": break; case "us2": break; case "us3": break; } break; } } model.environmentlist = new List<string> { "w1", "w2", "w3", "w4" }; model.region= new List<string> { "us1", "us2", "us3" }; return View(model); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)