Using Html.DisplayNameFor helper to generate some titles.

This commit is contained in:
Praburaj 2014-04-16 17:12:23 -07:00
parent 20d0fc9bd8
commit 506b439f2f
2 changed files with 9 additions and 14 deletions

View File

@ -13,7 +13,7 @@
<hr /> <hr />
<dl class="dl-horizontal"> <dl class="dl-horizontal">
<dt> <dt>
@Html.NameFor(model => model.Artist.Name) @Html.DisplayNameFor(model => model.Artist.Name)
</dt> </dt>
<dd> <dd>
@ -21,7 +21,7 @@
</dd> </dd>
<dt> <dt>
@Html.NameFor(model => model.Genre.Name) @Html.DisplayNameFor(model => model.Genre.Name)
</dt> </dt>
<dd> <dd>
@ -29,7 +29,7 @@
</dd> </dd>
<dt> <dt>
@Html.NameFor(model => model.Title) @Html.DisplayNameFor(model => model.Title)
</dt> </dt>
<dd> <dd>
@ -37,7 +37,7 @@
</dd> </dd>
<dt> <dt>
@Html.NameFor(model => model.Price) @Html.DisplayNameFor(model => model.Price)
</dt> </dt>
<dd> <dd>
@ -45,7 +45,7 @@
</dd> </dd>
<dt> <dt>
@Html.NameFor(model => model.AlbumArtUrl) @Html.DisplayNameFor(model => model.AlbumArtUrl)
</dt> </dt>
<dd> <dd>

View File

@ -24,23 +24,18 @@
@Html.ActionLink("Create New", "Create") @Html.ActionLink("Create New", "Create")
</p> </p>
<table class="table"> <table class="table">
@*Bug: Html.NameFor does not contain an overload taking in IEnumerable<Tmodel>*@
<tr> <tr>
<th> <th>
@*@Html.NameFor(model => model.Genre.Name)*@ @Html.DisplayNameFor(model => model.Genre.Name)
@Html.NameFor(model => model.FirstOrDefault().Genre.Name)
</th> </th>
<th> <th>
@*@Html.NameFor(model => model.Artist.Name)*@ @Html.DisplayNameFor(model => model.FirstOrDefault().Artist.Name)
@Html.NameFor(model => model.FirstOrDefault().Artist.Name)
</th> </th>
<th> <th>
@*@Html.NameFor(model => model.Title)*@ @Html.DisplayNameFor(model => model.FirstOrDefault().Title)
@Html.NameFor(model => model.FirstOrDefault().Title)
</th> </th>
<th> <th>
@*@Html.NameFor(model => model.Price)*@ @Html.DisplayNameFor(model => model.FirstOrDefault().Price)
@Html.NameFor(model => model.FirstOrDefault().Price)
</th> </th>
<th></th> <th></th>
</tr> </tr>