Hi kankon,
Please refer below sample.
HTML
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<asp:Button ID="btnShow" Text="Show" runat="server" OnClick="OnShow" />
<script type="text/javascript">
function AlertUpdate(title, message, type) {
swal(title, message, type);
}
</script>
Code
C#
protected void OnShow(object sender, EventArgs e)
{
ErrorMessage("Welcome", "ASPSnippets", "success");
}
public void ErrorMessage(string message, string title, string type)
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "Script", "AlertUpdate('" + title + "', '" + message + "', '" + type + "');", true);
}
VB.Net
Protected Sub OnShow(ByVal sender As Object, ByVal e As EventArgs) Handles btnShow.Click
ErrorMessage("Welcome", "ASPSnippets", "success")
End Sub
Public Sub ErrorMessage(ByVal message As String, ByVal title As String, ByVal type As String)
ScriptManager.RegisterStartupScript(Me, Me.GetType(), "Script", "AlertUpdate('" & title & "', '" & message & "', '" & type & "');", True)
End Sub
Screenshot