There are a couple changes you must make to use Email Address as the UserName:
- Change the UserName field to Email Address.
- In the control open tag you must add RequiresEmail=false
If you forget to set this you will get the error message:
RegisterUser: CreateUserWizardStep.ContentTemplate does not contain an IEditableTextControl with ID Email for the e-mail, this is required if RequireEmail = true.
- Next you will want to add a validator to your username field to ensure it is in email format. There are a few ways to do it. You can use the RegEx Validator as a minimum or extend it to do a DNS lookup depending on your needs. Below is a sample I got from a StackOverflow article:
<asp:RegularExpressionValidator ID="regexEmailValid" runat="server" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ControlToValidate="tbEmail" ErrorMessage="Invalid Email Format"></asp:RegularExpressionValidator>
If you have any tips, tricks or resources you would like to share with the guild email me at firstname.lastname@example.org