Javascript 如何在asp.net中使用sweet alert进行警报和重定向

Javascript 如何在asp.net中使用sweet alert进行警报和重定向,javascript,asp.net,sweetalert,Javascript,Asp.net,Sweetalert,您需要将引用添加到页面标题部分的SweetAlert库中: ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('User details saved successfully');window.location ='frmDisplayUsers.aspx';", true); 这就是我想要的….那么,当前代码有什么问题吗?没有问题。它只显示正常警报我想在sweet Alerts中显示它好吧

您需要将引用添加到页面标题部分的SweetAlert库中:

ScriptManager.RegisterStartupScript(this, this.GetType(), 
"alert", 
"alert('User details saved successfully');window.location ='frmDisplayUsers.aspx';", 
true);

这就是我想要的….

那么,当前代码有什么问题吗?没有问题。它只显示正常警报我想在sweet Alerts中显示它好吧,将它与sweet Alerts集成,在他们的网站上查看文档你会在这里找到你的答案我是初学者,很难理解,你能说得更具体些吗?我能添加更多的swal()属性,如自动关闭和其他东西吗???是的,你能,像这样:swal('User details saved successfully',{OPTIONS GO HERE})。然后(…)下面是一个示例:
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
ScriptManager.RegisterStartupScript(this, this.GetType(), 
"alert",
"swal('User details saved successfully').then((value) => { window.location ='frmDisplayUsers.aspx'; });", 
true);
ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "swal('Done !!!','User details saved successfully','success').then((value) => { window.location ='frmDisplayUsers.aspx'; });", true);