Skip to content

Commit

Permalink
Creating _ViewStart.cshtml and editing titles in other views
Browse files Browse the repository at this point in the history
  • Loading branch information
gorohoroh committed Jul 6, 2018
1 parent 597aa18 commit b70b41c
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 20 deletions.
13 changes: 4 additions & 9 deletions OdeToFoodRider/OdeToFoodRider/Views/Home/Create.cshtml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
@using OdeToFoodRider.Models
@model OdeToFoodRider.Models.Restaurant

<!DOCTYPE html>
@{
ViewBag.Title = "Create";
}

<html>
<head>
<title>Add a Restaurant</title>
</head>
<body>
<h1>Create</h1>

<form method="post">
Expand All @@ -29,6 +26,4 @@
<div asp-validation-summary="All"></div>
<div>

</div>
</body>
</html>
</div>
13 changes: 4 additions & 9 deletions OdeToFoodRider/OdeToFoodRider/Views/Home/Details.cshtml
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
@using OdeToFoodRider.Models
@model Restaurant

<!DOCTYPE html>
@{
ViewBag.Title = Model.Name;
}

<html>
<head>
<title>Restaurant details</title>
</head>
<body>
<h1>@Model.Name</h1>
<h1>@Model.Name</h1>
<div>Id: @Model.Id</div>
<div>Cuisine: @Model.Cuisine</div>
<a asp-action="Index" asp-controller="Home">Home</a>
</body>
</html>
1 change: 0 additions & 1 deletion OdeToFoodRider/OdeToFoodRider/Views/Home/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

@{
ViewBag.Title = "Home page";
Layout = "~/Views/Shared/_Layout.cshtml";
}

<h1>All Restaurants</h1>
Expand Down
3 changes: 3 additions & 0 deletions OdeToFoodRider/OdeToFoodRider/Views/_ViewStart.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@{
Layout = "~/Views/Shared/_Layout.cshtml";
}
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}

<h1>Create</h1>

<form method="post">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
@model OdeToFoodVisualStudio.Models.Restaurant

@{
ViewBag.Title = Model.Name;
}

<h1>@Model.Name</h1>

<div>Id: @Model.Id</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
@model OdeToFoodVisualStudio.ViewModels.HomeIndexViewModel

@{ ViewBag.Title = "Home page";
Layout = "~/Views/Shared/_Layout.cshtml";
}

<h1>All Restaurants</h1>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@{
Layout = "~/Views/Shared/_Layout.cshtml";
}

0 comments on commit b70b41c

Please sign in to comment.