Basaingeal / Razor.SweetAlert2

A Razor class library for interacting with SweetAlert2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Documentation]

davidbuckleyni opened this issue · comments

commented

You show using the component in mvc but you dont show how to use it in a controller yes you show the code.
But how do i register it on the controller side as when i use the below code it doesnt reconise swal.
Swal.FireAsync(
"Cancelled",
"Your imaginary file is safe :)",
SweetAlertIcon.Error
);

This library is meant to be used in front-end client-side applications written using the Blazor front-end framework, and it is not designed to work with MVC applications which only run on the server.

The razor code shown is only intended for .razor files and not .cshtml files. In an MVC application, I believe you'd be better off using the original sweetalert2 library for JavaScript.