protected function btnRegister_Click() { $strUsernameCandidate = QApplication::Tokenize($this->txtUsername->Text, false); // Create the Public Login record $objPublicLogin = PublicLogin::CreateForPerson($this->objOnlineDonation->Person, $this->txtUsername->Text, $this->txtPassword->Text, $this->lstQuestion->SelectedValue ? $this->lstQuestion->SelectedValue : $this->txtQuestion->Text, $this->txtAnswer->Text); // Set the Primary Email Address $objPublicLogin->Person->ChangePrimaryEmailTo($_SESSION['onlineDonationEmailAddress' . $this->objOnlineDonation->Id], false); // Login and Redirect QApplication::PublicLogin($objPublicLogin); QApplication::Redirect('/register/thankyou.php'); }