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:
@@ -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>
|
||||
Reference in New Issue
Block a user