protected void Contact_TextChanged(object sender, EventArgs e) { TextBox lContactTextBox = (TextBox)sender; if (Server.HtmlEncode(lContactTextBox.Text).Trim() != "") { if (lContactTextBox.ID == "Mobile_Number" && Request.Params["__EVENTTARGET"].ToString().Contains(User_FormView.FindControl("Mobile_Number").ID)) { Generate_OTP(); } else if (Request.Params["__EVENTTARGET"].ToString().Contains(User_FormView.FindControl("Email_Address").ID)) { MySqlConnection dbconn = new MySqlConnection(CommonClass.connectionstring); dbconn.Open(); UserClass.Generate_GUID(Server.HtmlEncode((User_FormView.FindControl("Email_Address") as TextBox).Text), Server.HtmlEncode((User_FormView.FindControl("User_Name") as TextBox).Text), User_FormView.FindControl("Email_Validation_Message") as Label, dbconn); Repeater lEmailRepeater = User_FormView.FindControl("Email_Repeater") as Repeater; Bind_Contacts("2", dbconn, lEmailRepeater); dbconn.Close(); } } else { if (lContactTextBox.ID == "Mobile_Number") { User_FormView.FindControl("OTP_Message").Visible = false; User_FormView.FindControl("Mobile_PlaceHolder").Visible = false; } else { User_FormView.FindControl("Email_Validation_Message").Visible = false; User_FormView.FindControl("Email_PlaceHolder").Visible = false; } } }