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.
This commit is contained in:
N. Taylor Mullen 2014-04-02 15:26:22 -07:00
parent 52ce83db9e
commit 94bae850c7
1 changed files with 53 additions and 0 deletions

View File

@ -262,4 +262,57 @@
</tr>
</table>
</div>
<div style="float: left; border: 5px solid green;">
<table>
<tr>
<td>
<label class="control-label col-md-2">DisplayFor Name</label>
</td>
<td>
'@Html.DisplayFor(model => model.Name)'
</td>
</tr>
<tr>
<td>
<label class="control-label col-md-2">DisplayFor Dependent.Name</label>
</td>
<td>
'@Html.DisplayFor(model => model.Dependent.Name)'
</td>
</tr>
<tr>
<td>
<label class="control-label col-md-2">DisplayFor Alive</label>
</td>
<td>
'@Html.DisplayFor(model => model.Alive)'
</td>
</tr>
<tr>
<td>
<label class="control-label col-md-2">DisplayFor Dependent.Alive</label>
</td>
<td>
'@Html.DisplayFor(model => model.Dependent.Alive)'
</td>
</tr>
<tr>
<td>
<label class="control-label col-md-2">DisplayFor Age</label>
</td>
<td>
'@Html.DisplayFor(model => model.Age)'
</td>
</tr>
<tr>
<td>
<label class="control-label col-md-2">DisplayFor GPA</label>
</td>
<td>
'@Html.DisplayFor(model => model.GPA)'
</td>
</tr>
</table>
</div>
</div>