Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
@page "/"
@using TodoListApp.Data
@inject IJSRuntime JsRuntime;
<EditForm Model="@usernameFormModel" OnValidSubmit="@HandleValidSubmit">
<DataAnnotationsValidator />
<ValidationSummary />
<InputText id="name" bind-Value="@usernameFormModel.Username" />
<button type="submit">Fetch Repositories</button>
@functions {
private UsernameFormModel usernameFormModel = new UsernameFormModel();
private async Task HandleValidSubmit() {
await JsRuntime.InvokeAsync<int>("alert", usernameFormModel.Username);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.