Skip to content

Instantly share code, notes, and snippets.

@hugoware
Created June 19, 2011 22:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hugoware/1034859 to your computer and use it in GitHub Desktop.
Save hugoware/1034859 to your computer and use it in GitHub Desktop.
Nested View Models in a Controller
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