after clicking the button it is redirectiong without displaying alert box
please tel the changes in the code.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;
public partial class feedback : System.Web.UI.Page
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
protected void Page_Load(object sender, EventArgs e)
{
con.Open();
}
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
SqlCommand cmd = new SqlCommand("insert into feed values('" + TextBox1.Text + "','" + TextBox4.Text + "','" + TextBox5.Text + "')", con);
cmd.ExecuteNonQuery();
con.Close();
string message = "Thank You For Your Feedback";
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(this.GetType(), "alert", sb.ToString());
Response.Redirect("home.aspx");
}
}