Make the ASP.NET demo more interesting

This commit is contained in:
Frank A. Krueger 2017-11-09 21:06:07 -08:00
parent ebf1d60bde
commit b124b3df7f
1 changed files with 13 additions and 2 deletions

View File

@ -15,8 +15,19 @@ namespace AspNetCoreMvc.Controllers
{ {
public IActionResult Index() public IActionResult Index()
{ {
var element = new Label { Text = "Hello Oooooui from Controller" }; var count = 0;
return new ElementResult (element); var head = new Heading { Text = "Ooui!" };
var label = new Label { Text = "0" };
var btn = new Button { Text = "Increase" };
btn.Clicked += (sender, e) => {
count++;
label.Text = count.ToString ();
};
var div = new Div ();
div.AppendChild (head);
div.AppendChild (label);
div.AppendChild (btn);
return new ElementResult (div);
} }
public IActionResult About() public IActionResult About()