[Solved] whenever I click signup nothing happens and no error occurs but data is not getting submitted. Please can some one answer?

Theo Asks: whenever I click signup nothing happens and no error occurs but data is not getting submitted. Please can some one answer?
whenever I click on signup nothing happens and no error occurs but data is not getting submitted and no catch block alert occurs. In Debug console it says Exception thrown: ‘System.Data.SqlClient.SqlException’ in System.Data.dll I have inlcuded all the required namespaces too.. I am new to this, can some one help me out?

Code:
string strcon = ConfigurationManager.ConnectionStrings["con"].ConnectionString;

Code:
protected void Button1_Click(object sender, EventArgs e)
        {
            
            try
            {
                SqlConnection con = new SqlConnection(strcon);
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
                SqlCommand cmd = new SqlCommand("insert into test(admin_id, admin_name) values(@admin_id, @admin_name)", con);

                cmd.Parameters.AddWithValue("@admin_id", TextBox1.Text.Trim());
                cmd.Parameters.AddWithValue("@admin_name", TextBox2.Text.Trim());

                cmd.ExecuteNonQuery();
                con.Close();
                Response.Write("<script>alert('success')</script>");

            }
            catch (Exception ex)
            {
                Response.Write("<script>alert('" + ex.Message + "');</script>");
            }
        }

here is the connection string for adding data in ms sql database This particular block is in web.config file

Code:
<connectionStrings>
    <add name="con" connectionString="Data Source=DESKTOP-RFLKVCF;Initial Catalog=test;Integrated Security=true"/>
  </connectionStrings>

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.