@page "/nettojs"
@inject IJSRuntime jsRuntime

<h3>This is a demo how to call JavaScript from .NET</h3>


<button @onclick="ShowAlert">Show Alert</button>
@code {
    protected async void ShowAlert()
    {
        IJSObjectReference jsRef = await jsRuntime.InvokeAsync<IJSObjectReference>("import", "/_content/Components/Pages/JSInteropSamples/NetToJS.razor.js");
        
        await jsRef.InvokeVoidAsync("showAlert", "Hello from .NET");
    }
}
