Skip to content

Commit

Permalink
Updated example to show how to ViewBag between the layout and the page
Browse files Browse the repository at this point in the history
  • Loading branch information
mikoskinen committed Jul 2, 2013
1 parent 63762bb commit d38449e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/template/Layout.cshtml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<html>
<head>
<title>@Model.Description;</title>
<title>@ViewBag.Title</title>
</head>
<body>
<p>This line is from the layout file.</p>
Expand Down
1 change: 1 addition & 0 deletions src/core/template/index.cshtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@{
_Layout = "./template/Layout.cshtml";
ViewBag.Title = Model.Description;
}

<h1>@Model.Description</h1>
Expand Down

0 comments on commit d38449e

Please sign in to comment.