Make the ASP.NET demo more interesting
This commit is contained in:
parent
ebf1d60bde
commit
b124b3df7f
|
@ -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()
|
||||||
|
|
Loading…
Reference in New Issue