Reputation: 153
ScriptManager.RegisterStartupScript(this, this.GetType(),
"alert",
"alert('User details saved successfully');window.location ='frmDisplayUsers.aspx';",
true);
Upvotes: -1
Views: 2479
Reputation: 153
ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "swal('Done !!!','User details saved successfully','success').then((value) => { window.location ='frmDisplayUsers.aspx'; });", true);
this was what i wanted.....
Upvotes: -1
Reputation: 539
You need to add a referene to the SweetAlert library in the head section of the page:
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
Then you need to change your code to this:
ScriptManager.RegisterStartupScript(this, this.GetType(),
"alert",
"swal('User details saved successfully').then((value) => { window.location ='frmDisplayUsers.aspx'; });",
true);
Upvotes: 1