Skip to content

Instantly share code, notes, and snippets.

@EdCharbeneau
Created August 29, 2018 17:41
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 EdCharbeneau/0dec7e99d526c14ef1872975a11b6f3a to your computer and use it in GitHub Desktop.
Save EdCharbeneau/0dec7e99d526c14ef1872975a11b6f3a to your computer and use it in GitHub Desktop.
Working with the Blazor JavaScript Interop 3
using Microsoft.JSInterop;
public class PromptInterop
{
/// <summary>
/// Invokes a browser prompt and returns the user's input.
/// </summary>
public static Task<string> PromptAsync(string message) {
return JSRuntime.Current.InvokeAsync<string>("myNamespace.showPrompt",message);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment