In my aspx project, I use javascript's window.confirm to prompt the user for various things. (I'll use a 3rd party package later - for now, my boss wants it this way.)
So, when a user clicks on the Update button, I use window.confirm(....) to confirm the update, then I update a database, and then I want to call window.confim(....)
one more time to tell the user the update was successful.
I make the javascript calls using ScriptManager.RegisterStartupScript(.....).
Well, it appears if I call ScriptManager more than once in a method, it only runs the first call, and blows right past the second call.
It roughly looks like this:
string wmsg = "Are you sure?";
string PassMsg = "ShowConfirmed('" + wmsg + "');";
ScriptManager.RegisterStartupScript(this, this.GetType(), System.Guid.NewGuid().ToString(), PassMsg, true);
Update_the_Database();
string wmsg = "Update sucessfull!";
string PassMsg = "ShowConfirmed('" + wmsg + "');";
ScriptManager.RegisterStartupScript(this, this.GetType(), System.Guid.NewGuid().ToString(), PassMsg, true);
Is there anything here that shows I'm doing something wrong?