Navigate to another Page After Clicking on JavaScript Alert

Leave a Comment
Hi All,

In following post we will see how to Navigate to another Page , after clicking on the Java Script Alert Ok , which is generally used for the Success Messages.

Please find the below Code snippet.


string NavigationUrl="http://www.google.com";

string NotificationScript = "window.onload = function(){ alert('";
                        NotificationScript += "Successfully Saved";
                        NotificationScript += "');";
                        NotificationScript += "window.location = '";
                        NotificationScript += NavigationUrl;
                        NotificationScript += "'; }";

Page.ClientScript.RegisterStartupScript(this.GetType(), "Redirect", NotificationScript, true);

Related Post

0 comments:

Post a Comment