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>