@page "/call-js-example-3" @inject IJSRuntime JS
@if (stockSymbol is not null) {
@stockSymbol price: @price.ToString("c")
} @if (result is not null) {@result
} @code { private Random r = new(); private string? stockSymbol; private decimal price; private string? result; private async Task SetStock() { stockSymbol = $"{(char)('A' + r.Next(0, 26))}{(char)('A' + r.Next(0, 26))}"; price = r.Next(1, 101); var interopResult = await JS.InvokeAsync