87
rated 0 times
[
89]
[
2]
/ answers: 1 / hits: 7963
/ 4 Years ago, sat, august 1, 2020, 12:00:00
I am trying create an alert message in within a Blazor component. I have no idea how to do this. I am running ASP.NET Core 3.1 Blazor server-side. Here's what I've tried
Component function:
private async Task ShowAlert()
{
await JSRuntime.InvokeAsync<object>("ShowMsg");
}
Javascript Interop:
function ShowMsg() {
success = "Success!";
return success;
}
File host.cshtml
:
<script src="~/BlazorInterop.js"></script>
More From » c#