protected void lnkforgotpassword_Click(object sender, EventArgs e) { if (txtEmail.Text != "Enter Email") { DataTable dt = new DataTable(); dt = objCustomer.GetCustomerByEmail(txtEmail.Text.Trim()); if (dt.Rows.Count > 0) { string password = Convert.ToString(dt.Rows[0]["Password"]); try { sendMail(txtEmail.Text, password); txtEmail.Text = ""; Page.RegisterStartupScript("a", "<script>alert('Thank you! Your password has been sent at your Email Address.')</script>"); } catch { Page.RegisterStartupScript("a", "<script>alert('Server Error..Please try later.')</script>"); } } else { Page.RegisterStartupScript("a", "<script>alert('This Email address does not exists our database, please enter another.')</script>"); } } else { lblMessage.Text = "Please enter your email address!!!"; } }
protected void btnRegisterNext_Click(object sender, EventArgs e) { dt = objCustomer.GetCustomerByEmail(txtEmailR.Text.Trim()); if (dt.Rows.Count > 0) { Page.RegisterStartupScript("a", "<script>alert('This Email Already exists our database, please choose another.')</script>"); } else { ViewState["FirstName"] = txtFirstName.Text; ViewState["EmailR"] = txtEmailR.Text.Trim(); ViewState["ContactR"] = txtContactNo.Text; txtAddress.Text = ""; txtCity.Text = ""; txtZip.Text = ""; txtLandmark.Text = ""; MultiView1.ActiveViewIndex = 1; } }