---
# System prepended metadata

title: mod01
tags: [mvc]

---

```csharp
// Views/Home/Index.cshtml
@{
    // ViewBag.Title = "Home Page";
    Layout = null;
}
<h1>Home</h1>

<form action="~/Home/SayHi" method="get">
    Name: <input name="username" /> <br />
    <input type="submit" value="Button" />
    <span>@ViewBag.greeting</span>
</form>

// Controllers/HomeController.cs
public ActionResult Index()
{           
    return View();
}
public ActionResult SayHi(string username)
{
    ViewBag.greeting = "Hi " + username;
    return View(nameof(Index));
}

```
