Skip to content

Instantly share code, notes, and snippets.

@cyberpirate92
Created May 15, 2019 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cyberpirate92/e05903ae1ad610bd31b2c5f51c4899ab to your computer and use it in GitHub Desktop.
Save cyberpirate92/e05903ae1ad610bd31b2c5f51c4899ab to your computer and use it in GitHub Desktop.
@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>
</EditForm>
@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