Created
February 22, 2011 21:13
-
-
Save vquaiato/839404 to your computer and use it in GitHub Desktop.
Controller usanod collection para criar dopdown na view
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Collections.Generic; | |
| using System.Web.Mvc; | |
| using MvcApplication5.Models; | |
| namespace MvcApplication5.Controllers | |
| { | |
| public class HomeController : Controller | |
| { | |
| public ActionResult Index() | |
| { | |
| var manolos = new List<Manolo> | |
| { | |
| new Manolo {Nome = "Manolo 1"}, | |
| new Manolo {Nome = "Manolo 2"}, | |
| new Manolo {Nome = "Manolo 3"}, | |
| new Manolo {Nome = "Manolo 4"}, | |
| new Manolo {Nome = "Manolo 5"}, | |
| }; | |
| ViewBag.Manolos = manolos; | |
| return View(new Manolo { Nome = "Manolo 3" }); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment