Hi ladies and gentlemen,
I am trying to call the alert from the button, and after the alert I want it to redirect to my home page. However when I call the below code from asp button
ClientScript.RegisterStartupScript(this.GetType(), "Success", "alert('" + "Activation mail has been sent to the email address. Please check your email!" + "');window.location.href('Home.aspx');", true);
It doesn't work. The alert can be call so this javascript is correct. What I suspect is the postback cause the redirect doesn't work. So I put the update panel as the result the button cannot be call the function at all.
In the end I tried to put return false in the javascript also not working.
I also tried to put response redirect after call the javascript function but the javascript and the behind code running synchronize so the page will be redirect before the alert will call.
How I can achieve my scenario?