1
0
mirror of https://github.com/rudollee/LearningMVC.git synced 2026-08-12 00:42:57 +00:00

Ch. 20 View - WorkingWithRazor

This commit is contained in:
wook
2017-04-13 21:41:51 +09:00
parent f22761fe5c
commit a3ef7da060
19 changed files with 540 additions and 0 deletions
@@ -0,0 +1,4 @@
<div>
This is the message from the partial view.
@Html.ActionLink("This is a link to the Index action", "Index")
</div>
@@ -0,0 +1,10 @@
@model IEnumerable<string>
<div>
This is the message from the partial view
<ul>
@foreach (string str in Model)
{
<li>@str</li>
}
</ul>
</div>
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<style type="text/css">
div.layout { background-color: lightgray; }
div.view { border: thin solid black; margin: 10px 0;}
</style>
<title>@ViewBag.Title</title>
</head>
<body>
@RenderSection("Header")
<div class="layout">
This is part of the layout
</div>
@RenderSection("Body")
<div class="layout">
This is part of the layout
</div>
@RenderSection("Footer")
<div class="layout">
This is part of the layout
</div>
@RenderSection("scripts", false)
</body>
</html>