From 506b439f2fe6ff7b4ef7a06dc7dff0348908d304 Mon Sep 17 00:00:00 2001 From: Praburaj Date: Wed, 16 Apr 2014 17:12:23 -0700 Subject: [PATCH] Using Html.DisplayNameFor helper to generate some titles. --- src/MusicStore/Views/StoreManager/Details.cshtml | 10 +++++----- src/MusicStore/Views/StoreManager/Index.cshtml | 13 ++++--------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/MusicStore/Views/StoreManager/Details.cshtml b/src/MusicStore/Views/StoreManager/Details.cshtml index 767d3e4cdb..21e3155834 100644 --- a/src/MusicStore/Views/StoreManager/Details.cshtml +++ b/src/MusicStore/Views/StoreManager/Details.cshtml @@ -13,7 +13,7 @@
- @Html.NameFor(model => model.Artist.Name) + @Html.DisplayNameFor(model => model.Artist.Name)
@@ -21,7 +21,7 @@
- @Html.NameFor(model => model.Genre.Name) + @Html.DisplayNameFor(model => model.Genre.Name)
@@ -29,7 +29,7 @@
- @Html.NameFor(model => model.Title) + @Html.DisplayNameFor(model => model.Title)
@@ -37,7 +37,7 @@
- @Html.NameFor(model => model.Price) + @Html.DisplayNameFor(model => model.Price)
@@ -45,7 +45,7 @@
- @Html.NameFor(model => model.AlbumArtUrl) + @Html.DisplayNameFor(model => model.AlbumArtUrl)
diff --git a/src/MusicStore/Views/StoreManager/Index.cshtml b/src/MusicStore/Views/StoreManager/Index.cshtml index 15177811e3..e76a49c734 100644 --- a/src/MusicStore/Views/StoreManager/Index.cshtml +++ b/src/MusicStore/Views/StoreManager/Index.cshtml @@ -24,23 +24,18 @@ @Html.ActionLink("Create New", "Create")

- @*Bug: Html.NameFor does not contain an overload taking in IEnumerable*@
- @*@Html.NameFor(model => model.Genre.Name)*@ - @Html.NameFor(model => model.FirstOrDefault().Genre.Name) + @Html.DisplayNameFor(model => model.Genre.Name) - @*@Html.NameFor(model => model.Artist.Name)*@ - @Html.NameFor(model => model.FirstOrDefault().Artist.Name) + @Html.DisplayNameFor(model => model.FirstOrDefault().Artist.Name) - @*@Html.NameFor(model => model.Title)*@ - @Html.NameFor(model => model.FirstOrDefault().Title) + @Html.DisplayNameFor(model => model.FirstOrDefault().Title) - @*@Html.NameFor(model => model.Price)*@ - @Html.NameFor(model => model.FirstOrDefault().Price) + @Html.DisplayNameFor(model => model.FirstOrDefault().Price)