Created
February 22, 2011 21:14
-
-
Save vquaiato/839406 to your computer and use it in GitHub Desktop.
View acessando uma collection para criar um dorpdown
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
| @model MvcApplication5.Models.Manolo | |
| @using System.Linq; | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Index</title> | |
| </head> | |
| <body> | |
| <div> | |
| @Html.DropDownListFor(model => model.Nome, | |
| ((IEnumerable<MvcApplication5.Models.Manolo>)ViewBag.Manolos).Select(o => new SelectListItem | |
| { | |
| Selected = o.Nome == Model.Nome, | |
| Text = o.Nome, | |
| Value = o.Nome | |
| })) | |
| </div> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment