From 94bae850c7b610027ac35128707d0f3deda560a3 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Wed, 2 Apr 2014 15:26:22 -0700 Subject: [PATCH] Add sample for DisplayFor Html Helper. Showcased a lot of the core pieces of DisplayFor in the sample. Some pieces are still missing such as DataType handling. The infrastructure is there to handle it in the TemplateRenderer but the model metadata providers do not construct the metadata with the data types. --- .../MvcSample.Web/Views/Shared/MyView.cshtml | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/samples/MvcSample.Web/Views/Shared/MyView.cshtml b/samples/MvcSample.Web/Views/Shared/MyView.cshtml index 054b6a286c..4541e0251d 100644 --- a/samples/MvcSample.Web/Views/Shared/MyView.cshtml +++ b/samples/MvcSample.Web/Views/Shared/MyView.cshtml @@ -262,4 +262,57 @@ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + '@Html.DisplayFor(model => model.Name)' +
+ + + '@Html.DisplayFor(model => model.Dependent.Name)' +
+ + + '@Html.DisplayFor(model => model.Alive)' +
+ + + '@Html.DisplayFor(model => model.Dependent.Alive)' +
+ + + '@Html.DisplayFor(model => model.Age)' +
+ + + '@Html.DisplayFor(model => model.GPA)' +
+
+ \ No newline at end of file