1
0
mirror of https://github.com/rudollee/LearningMVC.git synced 2026-08-11 16:32:55 +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
+32
View File
@@ -0,0 +1,32 @@
@model string[]
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";
}
@section Header {
<div class="view">
@foreach (string str in new[] { "Home", "List", "Edit" })
{
@Html.ActionLink(str, str, null, new { style = "margin: 5px" })
}
</div>
}
@section Body {
<div class="view">
This is a list of fruit names:
@foreach (string name in Model)
{
<span><b>@name</b></span>
<p />
}
</div>
}
@section Footer{
<div class="View">
This is the footer
</div>
}
+3
View File
@@ -0,0 +1,3 @@
@model DateTime
<p>The time is: @Model.ToShortTimeString()</p>