learner

learner

  • NA
  • 11
  • 0

Problem with clearing controls after the form registration!

Dec 2 2009 10:01 AM
Hi I am in a situation to clear the all controls after clicking the register button,and one label should gives message as "Records Registerd" .But here ,my control are clearing ,but label is not giving any msg!it remaons the same. I made tht invisible in page load,but its not visible after registration. How to do? Here is my code!! protected void BtnRegister_Click(object sender, EventArgs e) { SqlConnection conn = new SqlConnection(ConfigurationManager.AppSettings["StrConn"]); conn.Open(); string insertquery = @"insert into Register(Name,Address1,Address2,Zipcode,City,Country,PhoneNo,Email,Sex) values('" + TxtName.Text + "','" + TxtAddr1.Text + "','" + TxtAddr2.Text + "','" + TxtZipcode.Text + "','" + ddlcity.SelectedItem + "','" + ddrCountry.SelectedItem + "','" + TxtPhoneno.Text + "','" + TxtEmail.Text + "','" + rdbSex.SelectedValue + "')"; SqlCommand cmd1 = new SqlCommand(insertquery, conn); cmd1.ExecuteNonQuery(); Response.Write(""); Label12.Text = "Record Registered!"; Label12.Visible = true; conn.Close(); }