Exemple #1
0
        protected void txtEmailID_TextChanged(object sender, EventArgs e)
        {
            try
            {
                if (!string.IsNullOrEmpty(txtEmailid.Text.ToString()))
                {
                    CanvasBizProcess canvBiz = new CanvasBizProcess();
                    canvBiz = new CanvasBizProcess();
                    if (txtEmailid.Text.Contains(">") || txtEmailid.Text.Contains("<") || txtEmailid.Text.Contains("'") || txtEmailid.Text.Contains("--") || txtEmailid.Text.Contains("%"))
                    {
                        txtEmailid.Text = "";
                    }
                    else
                    {
                        int result = canvBiz.CheckUserEmail(txtEmailid.Text.TrimStart(' ').TrimEnd(' '));
                        if (result == 0)
                        {
                            txtOrganization.Focus();
                        }
                        else
                        {
                            string alertScript = "alert('This e-mail ID already exists!');";
                            ScriptManager.RegisterStartupScript(this, GetType(), "Key", alertScript, true);
                            txtEmailid.Focus();
                            txtEmailid.Text = "";

                        }
                    }
                }
            }
            catch (Exception ex)
            {
                objCommonUtil.SendErrorMail(ex.Message, ex.StackTrace, System.Reflection.MethodBase.GetCurrentMethod().Name.ToString(), System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.ToString(), SessionData.Customer.CustomerID);
            }
        }