TAILIEUCHUNG - ASP.NET 4 Unleased - p 121

Using the Login Controls protected void CreateUserWizard1_SendingMail(object sender, MailMessageEventArgs e) { MembershipUser user = (); string code = (); = (“”, code); } CreateUserWizard Code Confirmation | 1174 CHAPTER 26 Using the Login Controls protected void CreateUserWizard1_SendingMail object sender MailMessageEventArgs e Membershipuser user string code ConfirmationCode code script html xmlns http 1999 xhtml head id Head1 runat server title CreateUserWizard Code Confirmation title head body form id form1 runat server div asp CreateUserWizard id CreateUserWizard1 CompleteSuccessText A confirmation email containing your new password has been sent to your email address. DisableCreatedUser true ContinueDestinationPageUrl OnSendingMail CreateUserWizard1_SendingMail Runat server MailDefinition From Admin@ BodyFileName IsBodyHtml true Subject Registration Confirmation asp CreateUserWizard div form body html The page in Listing includes a SendingMail event handler. The confirmation code is the unique key assigned to the new user by the membership provider a GUID . The confirmation code is substituted into the email message before the message is sent. The email message is contained in Listing . From the Library of Wow eBook Using the CreateUserWizard Control 1175 LISTING DOCTYPE html PUBLIC - W3C DTD XHTML Transitional EN http TR xhtml1 DTD html xmlns http 1999 xhtml head title Code Confirmation title head body UserName your confirmation code is ConfirmationCode body html After you complete the form rendered by the CreateUserWizard control you can click the Continue button to open the page in Listing see Figure . FIGURE Entering a confirmation code. 26 From the Library of Wow eBook 1176 CHAPTER 26 Using the Login Controls LISTING @ Page Language C DOCTYPE html PUBLIC - W3C DTD XHTML Transitional EN http TR xhtml1 DTD .