Created
June 19, 2011 22:42
-
-
Save hugoware/1034859 to your computer and use it in GitHub Desktop.
Nested View Models in a Controller
This file contains 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
public class HomeController : Controller { | |
public ActionResult Index() { | |
var view = new ViewFor.Index { Name = "Hugo" }; | |
return this.View(view); | |
} | |
public static class ViewFor { | |
public class Index { | |
public string Name { get; set; } | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment