Para el ejemplo crearemos un mensaje de alerta muy vistoso con la librería Sweetalert2, crearemos una Webforms.
llamaremos la librería:
https://cdn.jsdelivr.net/npm/sweetalert2@11
y un botón llamado btnAlerta.
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="btnAlerta" runat="server" Text="Mostrar Alerta" OnClick="btnAlerta_Click" />
</div>
</form>
</body>
</html>
Podemos cambiar el icono dependiendo el tipo de mensaje.
icon: 'success', icon: 'error', icon: 'warning', icon: 'info', icon: 'question
Ejecutamos la forma y presionamos el botón.
0 Comentarios