I have a simple Blazor application.
I have a label in my HTML portion of the .Razor page. In the @code section, I have a public class with a few properties, and I'm trying to simply display the values from my class in the labels.
Code below:
<label>@How To Display EmailAddressHere</label>
<label>@How To Display Body</label>
@code {
public class EmailItems
{
public string EmailAddress { get; set; }
public string Body { get; set; }
}
protected override void OnInitialized()
{
var emailItems = new EmailItems()
{
Body = "testBody",
EmailAddress= "jdoe@gmail.com",
};
}
}