I am trying to show the "Insert Successful" message in the pop up window first then the page will redirect to the different page. But when I add the Response.Redirect after the java-script, it will jump to next page without showing the message box. Thanks for your help!

```
 try
        {
            connnew.Open();
            cmdnew.ExecuteNonQuery();
            string message = "Form Generated Successfully";
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            sb.Append("<script type = 'text/javascript'>");
            sb.Append("window.onload=function(){");
            sb.Append("alert('");
            sb.Append(message);
            sb.Append("')};");
            sb.Append("</script>");
            ClientScript.RegisterClientScriptBlock(form1.GetType(), "alert", sb.ToString());

            Response.Redirect("AllRecords.aspx");
        }

```