e.g. 3.5 Retrieving a ViewBag Data Value
e.g. 3.6 Displaying Details of the Party
This commit is contained in:
parent
204f54b04a
commit
5945309b12
@ -10,6 +10,8 @@ namespace PartyInvites.Controllers
|
|||||||
{
|
{
|
||||||
public ActionResult Index()
|
public ActionResult Index()
|
||||||
{
|
{
|
||||||
|
int hour = DateTime.Now.Hour;
|
||||||
|
ViewBag.Greeting = hour < 12 ? "Good morning" : "Good afternoon";
|
||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div>
|
<div>
|
||||||
Hello, world (from the view)
|
@ViewBag.Greeting, world (from the view)
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
x
Reference in New Issue
Block a user