@page "/"
<EditForm Model="model" OnValidSubmit="Submit">
<DataAnnotationsValidator />
<ValidationSummary />
<MyInputComponent @bind-BindingValue="model.Name" />
<button type="submit">Submit</button>
</EditForm>
<p>@result</p>
@code {
public class User{
public string Name {get; set; }
public string Street {get; set; }
}
protected string result;
User model = new User() { Name = "My Name" };
private void Submit()
{
result = model.Name;
}
}