Instruction For Recipe World
Instruction For Recipe World
Instruction For Recipe World
Copy & paste all (yang highlight kuning tu yang aku add kalau ada part yg kau dah buat tambah yg
aku highlight je)
Controller
1. Controllers> HomeController.cs
using Microsoft.AspNetCore.Mvc;
using RecipeWorld.Models;
using System.Diagnostics;
namespace RecipeWorld.Controllers
{
public class HomeController : Controller
{
private readonly ILogger<HomeController> _logger;
2. Views> Home> add view> Razor view-empty (ikut nama action method yg highlight warna
hijau dkt atas buat satu-satu)
AboutUs.cshtml
@{
ViewData["Title"] = "About Us";
}
<h1>@ViewData["Title"]</h1>
<p>
Recipe World is a dynamic recipe sharing website that was established in 2010
with a simple yet powerful mission: to connect food enthusiasts from around the
world
and inspire them to explore the vast and diverse world of recipes. Founded by
a team of passionate individuals with a deep appreciation for culinary arts,
Recipe World quickly became a go-to platform for home cooks, professional
chefs, and anyone seeking culinary inspiration.
From its humble beginnings, Recipe World has grown into a global community of
food lovers united by their shared love for cooking and exploration. With a vast
collection of meticulously curated recipes, spanning traditional classics to
innovative creations, Recipe World offers an extensive culinary library to
satisfy every taste and dietary preference.
Looking ahead, Recipe World envisions a future where individuals from every
corner of the world can come together, sharing their culinary heritage,
exchanging ideas, and embracing the joy of cooking. The company is committed to
fostering a global community that celebrates the diversity of flavors and
encourages individuals to embark on their own culinary journeys. With Recipe
World, the possibilities in the world of recipes are endless.
</p>
Index.cshtml
@{
ViewData["Title"] = "Home Page";
}
<div class="text-center">
<h1 class="display-4">Welcome</h1>
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-
action="Index"><img src="~/Image\Recipe World logo.jpg" height="200px"
width="200px" /></a>
<p>
Welcome to Recipe World where
</div>
PopularItems.cshtml
@{
ViewData["Title"] = "Popular Items";
}
<h1>@ViewData["Title"]</h1>
Privacy.cshtml
@{
ViewData["Title"] = "Privacy Policy";
}
<h1>@ViewData["Title"]</h1>
Recipe.cshtml
@{
ViewData["Title"] = "Recipe";
}
<h1>@ViewData["Title"]</h1>
wwwroot
3. wwwroot> create new folder “image”> right-click image folder> open folder
in file explorer> copy logo image from laptop transfer to wwwroot image
file pastu tutup file explorer>. Wwwroot> right-click image file> click
image> check file path & copy dari image sampai habis
5. View> Shared>_Layout.cshtml
!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - Recipe World</title>
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
</head>
<body>
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-
white border-bottom box-shadow mb-3">
<div class="container-fluid">
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-
action="Index"><img src="~/Image\Recipe World logo.jpg" height="70px"
width="70px"/></a>
<button class="navbar-toggler" type="button" data-bs-
toggle="collapse" data-bs-target=".navbar-collapse" aria-
controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse d-sm-inline-flex justify-
content-between">
<ul class="navbar-nav flex-grow-1">
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-
controller="Home" asp-action="Index">Home</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-
controller="Home" asp-action="Recipe">Recipe</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-
controller="Home" asp-action="PopularItems">Popular Items</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-
controller="Home" asp-action="AboutUs">About Us</a>
</li>
<li>
<input type="text" id="searchInput"
placeholder="Enter your search term" />
<button type="button"
onclick="search()">Search</button>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="container">
<main role="main" class="pb-3">
@RenderBody()
</main>
</div>