From b70b41ca6345c7fd5bf4d85a896e8aa6edd4b4c7 Mon Sep 17 00:00:00 2001 From: gorohoroh Date: Fri, 6 Jul 2018 20:14:03 +0300 Subject: [PATCH] Creating _ViewStart.cshtml and editing titles in other views --- .../OdeToFoodRider/Views/Home/Create.cshtml | 13 ++++--------- .../OdeToFoodRider/Views/Home/Details.cshtml | 13 ++++--------- .../OdeToFoodRider/Views/Home/Index.cshtml | 1 - .../OdeToFoodRider/Views/_ViewStart.cshtml | 3 +++ .../OdeToFoodVisualStudio/Views/Home/Create.cshtml | 4 ++++ .../OdeToFoodVisualStudio/Views/Home/Details.cshtml | 4 ++++ .../OdeToFoodVisualStudio/Views/Home/Index.cshtml | 1 - .../OdeToFoodVisualStudio/Views/_ViewStart.cshtml | 3 +++ 8 files changed, 22 insertions(+), 20 deletions(-) create mode 100644 OdeToFoodRider/OdeToFoodRider/Views/_ViewStart.cshtml create mode 100644 OdeToFoodVisualStudio/OdeToFoodVisualStudio/Views/_ViewStart.cshtml diff --git a/OdeToFoodRider/OdeToFoodRider/Views/Home/Create.cshtml b/OdeToFoodRider/OdeToFoodRider/Views/Home/Create.cshtml index 3719399..cd51ea0 100644 --- a/OdeToFoodRider/OdeToFoodRider/Views/Home/Create.cshtml +++ b/OdeToFoodRider/OdeToFoodRider/Views/Home/Create.cshtml @@ -1,13 +1,10 @@ @using OdeToFoodRider.Models @model OdeToFoodRider.Models.Restaurant - +@{ + ViewBag.Title = "Create"; +} - - - Add a Restaurant - -

Create

@@ -29,6 +26,4 @@
-
- - \ No newline at end of file + \ No newline at end of file diff --git a/OdeToFoodRider/OdeToFoodRider/Views/Home/Details.cshtml b/OdeToFoodRider/OdeToFoodRider/Views/Home/Details.cshtml index b33d9a2..07f5958 100644 --- a/OdeToFoodRider/OdeToFoodRider/Views/Home/Details.cshtml +++ b/OdeToFoodRider/OdeToFoodRider/Views/Home/Details.cshtml @@ -1,16 +1,11 @@ @using OdeToFoodRider.Models @model Restaurant - +@{ + ViewBag.Title = Model.Name; +} - - - Restaurant details - - -

@Model.Name

+

@Model.Name

Id: @Model.Id
Cuisine: @Model.Cuisine
Home - - \ No newline at end of file diff --git a/OdeToFoodRider/OdeToFoodRider/Views/Home/Index.cshtml b/OdeToFoodRider/OdeToFoodRider/Views/Home/Index.cshtml index 0327798..f177fe4 100644 --- a/OdeToFoodRider/OdeToFoodRider/Views/Home/Index.cshtml +++ b/OdeToFoodRider/OdeToFoodRider/Views/Home/Index.cshtml @@ -3,7 +3,6 @@ @{ ViewBag.Title = "Home page"; - Layout = "~/Views/Shared/_Layout.cshtml"; }

All Restaurants

diff --git a/OdeToFoodRider/OdeToFoodRider/Views/_ViewStart.cshtml b/OdeToFoodRider/OdeToFoodRider/Views/_ViewStart.cshtml new file mode 100644 index 0000000..c34f4d5 --- /dev/null +++ b/OdeToFoodRider/OdeToFoodRider/Views/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "~/Views/Shared/_Layout.cshtml"; +} \ No newline at end of file diff --git a/OdeToFoodVisualStudio/OdeToFoodVisualStudio/Views/Home/Create.cshtml b/OdeToFoodVisualStudio/OdeToFoodVisualStudio/Views/Home/Create.cshtml index 016a7c1..5c39f61 100644 --- a/OdeToFoodVisualStudio/OdeToFoodVisualStudio/Views/Home/Create.cshtml +++ b/OdeToFoodVisualStudio/OdeToFoodVisualStudio/Views/Home/Create.cshtml @@ -2,6 +2,10 @@ @model OdeToFoodVisualStudio.Models.Restaurant @* VSRD: Visual Studio gives no import suggestions for model declaration - have to type in FQN (for which there is completion) *@ +@{ + ViewBag.Title = "Create"; +} +

Create

diff --git a/OdeToFoodVisualStudio/OdeToFoodVisualStudio/Views/Home/Details.cshtml b/OdeToFoodVisualStudio/OdeToFoodVisualStudio/Views/Home/Details.cshtml index 688e035..ef3cdaf 100644 --- a/OdeToFoodVisualStudio/OdeToFoodVisualStudio/Views/Home/Details.cshtml +++ b/OdeToFoodVisualStudio/OdeToFoodVisualStudio/Views/Home/Details.cshtml @@ -1,5 +1,9 @@ @model OdeToFoodVisualStudio.Models.Restaurant +@{ + ViewBag.Title = Model.Name; +} +

@Model.Name

Id: @Model.Id
diff --git a/OdeToFoodVisualStudio/OdeToFoodVisualStudio/Views/Home/Index.cshtml b/OdeToFoodVisualStudio/OdeToFoodVisualStudio/Views/Home/Index.cshtml index 1b9939f..9e888ca 100644 --- a/OdeToFoodVisualStudio/OdeToFoodVisualStudio/Views/Home/Index.cshtml +++ b/OdeToFoodVisualStudio/OdeToFoodVisualStudio/Views/Home/Index.cshtml @@ -2,7 +2,6 @@ @model OdeToFoodVisualStudio.ViewModels.HomeIndexViewModel @{ ViewBag.Title = "Home page"; - Layout = "~/Views/Shared/_Layout.cshtml"; }

All Restaurants

diff --git a/OdeToFoodVisualStudio/OdeToFoodVisualStudio/Views/_ViewStart.cshtml b/OdeToFoodVisualStudio/OdeToFoodVisualStudio/Views/_ViewStart.cshtml new file mode 100644 index 0000000..2de6241 --- /dev/null +++ b/OdeToFoodVisualStudio/OdeToFoodVisualStudio/Views/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "~/Views/Shared/_Layout.cshtml"; +}