예제 #1
0
        public IActionResult Index()
        {
            MeuModel mm = new MeuModel
            {
                nome = "Joab",
                sexo = 0
            };

            var array = new[]
            {
                new { value = 0, text = "Masculino" },
                new { value = 1, text = "Feminino" }
            };

            SelectList opcoes = new SelectList(array, "value", "text", 0);

            ViewData["opcoes"] = opcoes;

            return(View(mm));
        }
예제 #2
0
 public IActionResult Index(MeuModel meuModel)
 {
     return(View());
 }