ScriptManager.RegisterStartupScript(this, this.GetType(),
"alert",
"alert('User details saved successfully');window.location ='frmDisplayUsers.aspx';",
true);
答案 0 :(得分:1)
您需要在页面顶部的SweetAlert库中添加参照资源:
<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);
答案 1 :(得分:0)
ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "swal('Done !!!','User details saved successfully','success').then((value) => { window.location ='frmDisplayUsers.aspx'; });", true);
这就是我想要的.....