Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Trying to bind value and display, not working

$
0
0

Ok, so I am VERY NEW at Blazor (coming from old school Webforms), and have a simple Web App (InteractiveAuto) where I am testing simply binding values to a class. It's not working, when I tab out of the MudTextFields the corresponding MudText does not update. I know it is a very noob situation, but can anyone slap me a tell me why?

@page "/"<PageTitle>Home</PageTitle><MudAlert Severity="Severity.Error">You are delinquent on your payments.</MudAlert><h1>Hello, world!</h1><MudText>@testClass.Id</MudText><MudText>@testClass.Name</MudText><MudText>@testClass.Counter</MudText><br /><MudTextField T="string" @bind-Value="testClass.Name"></MudTextField><MudTextField T="int" @bind-Value="testClass.Counter"></MudTextField>Welcome to your new app.@code {    MyData testClass = new MyData    {        Id = 1,        Name = "Jimmy",        Counter = 5    };    class MyData    {        public int Id { get; set; }        public string Name { get; set; } = "";        public int Counter { get; set; }    }}

Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>