@code { [Inject] public IJSRuntime JsRuntime { get; set; } [Parameter] public RenderFragment Title { get; set; } [Parameter] public RenderFragment Body { get; set; } private string message = ""; private string elementid = "modal_error"; public void Open(string message = "") { this.message = message; JsRuntime.InvokeVoidAsync("OpenModal", elementid); } public void Close() { JsRuntime.InvokeVoidAsync("CloseModal", elementid); } }