From 7470e3cb289411f540dd8b9121de6c3b88bad8e0 Mon Sep 17 00:00:00 2001 From: Praburaj Date: Wed, 30 Jul 2014 15:13:25 -0700 Subject: [PATCH] @Html.ValueFor replaced with @Html.DisplayFor The original sample used @Html.DisplayFor. While porting I changed it to use ValueFor. Xinyang pointed out this difference. Fixing this so that it can be easily compared with the original sample. The results of the view unchanged. --- src/MusicStore/Views/Store/Details.cshtml | 2 +- src/MusicStore/Views/StoreManager/Details.cshtml | 10 +++++----- src/MusicStore/Views/StoreManager/Index.cshtml | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/MusicStore/Views/Store/Details.cshtml b/src/MusicStore/Views/Store/Details.cshtml index 4b07337acc..042f5dcd07 100644 --- a/src/MusicStore/Views/Store/Details.cshtml +++ b/src/MusicStore/Views/Store/Details.cshtml @@ -21,7 +21,7 @@

Price: - @Html.ValueFor(model => model.Price) + @Html.DisplayFor(model => model.Price)

@Html.ActionLink("Add to cart", "AddToCart", "ShoppingCart", new { id = Model.AlbumId }) diff --git a/src/MusicStore/Views/StoreManager/Details.cshtml b/src/MusicStore/Views/StoreManager/Details.cshtml index dd72e8d82f..3e65c71cc6 100644 --- a/src/MusicStore/Views/StoreManager/Details.cshtml +++ b/src/MusicStore/Views/StoreManager/Details.cshtml @@ -15,7 +15,7 @@

- @Html.ValueFor(model => model.Artist.Name) + @Html.DisplayFor(model => model.Artist.Name)
@@ -23,7 +23,7 @@
- @Html.ValueFor(model => model.Genre.Name) + @Html.DisplayFor(model => model.Genre.Name)
@@ -31,7 +31,7 @@
- @Html.ValueFor(model => model.Title) + @Html.DisplayFor(model => model.Title)
@@ -39,7 +39,7 @@
- @Html.ValueFor(model => model.Price) + @Html.DisplayFor(model => model.Price)
@@ -47,7 +47,7 @@
- @Html.ValueFor(model => model.AlbumArtUrl) + @Html.DisplayFor(model => model.AlbumArtUrl)
diff --git a/src/MusicStore/Views/StoreManager/Index.cshtml b/src/MusicStore/Views/StoreManager/Index.cshtml index 74f258fa3d..59a3f2798c 100644 --- a/src/MusicStore/Views/StoreManager/Index.cshtml +++ b/src/MusicStore/Views/StoreManager/Index.cshtml @@ -42,7 +42,7 @@ { - @Html.ValueFor(modelItem => item.Genre.Name) + @Html.DisplayFor(modelItem => item.Genre.Name) @Truncate(item.Artist.Name, 25) @@ -51,7 +51,7 @@ @Truncate(item.Title, 25) - @Html.ValueFor(modelItem => item.Price) + @Html.DisplayFor(modelItem => item.Price) @Html.ActionLink("Edit", "Edit", new { id = item.AlbumId }) |