protected void btnSignup_Click(object sender, EventArgs e) { Page.Validate(); if (Page.IsValid) { Customer customer = new Customer { email = txtEmail.Text, password = CryptographyModel.encryptPassword(txtPassword.Text), name = txtName.Text, street = txtStreet.Text, zip = txtPostalcode.Text, municipality = txtMunicipality.Text, isVerified = false }; try { SignUpModel signUpModel = new SignUpModel(); if (signUpModel.beginSignUpProcess(customer)) //Throws NoRecordException || DALException { pnlSignup.Visible = false; lblHeader.Text = "Welcome to Taboelaert Raesa!"; lblEmailSent.Text = "An email has been sent to " + customer.email + ". Please follow the instructions in the email to complete your registration."; pnlSignupCompleted.Visible = true; } else { pnlSignup.Visible = false; lblEmailSent.Text = "An error occured while completing your registration, please try again later. Contact our support if this problem persists."; pnlSignupCompleted.Visible = true; } } catch (NoRecordException) { pnlSignup.Visible = false; lblEmailSent.Text = "An error occured while completing your registration, please try again later. Contact our support if this problem persists."; pnlSignupCompleted.Visible = true; } } }