Unfortunately, there is not implementation of such useful functions in Blazor yet.
So you need to use JSRuntime instance.
@inject IJSRuntime JsRuntime
...
@code
{
//...
await JsRuntime.InvokeVoidAsync("alert", "Warning!"); // Alert
bool confirmed = await JsRuntime.InvokeAsync<bool>("confirm", "Are you sure?"); // Confirm
string prompted = await JsRuntime.InvokeAsync<string>("prompt", "Take some input:"); // Prompt
//...
}
No comments:
Post a Comment