Thursday, May 18, 2006 - Posts

Customizing Membership Controls - Part II

In my last blog i blogged about customizing email content sent using membership controls.Other important customization is auto-generating passwords to validate the registered user account. By default, CreateUserWizard allows user to enter the email, password and security question and answer. However, this way, you can’t validate the user email id, so you might want to sent the password through mail to the registered user email id. By this way, you can validate the registered use email account.

 

For this, CreateUserWizard Control provides a feature called “AutoGeneratePassword”. If you set this property to true, CreateUserWizard will auto generate the password for user and sent it to registered email account. Email sent to the user can be customized as explained in my previous blog

  

Other feature you want in CreateUserWizard is validation for unique email. By default, membership control does not validate the email for uniqueness. You can enable this validation in membership provider setting in  .config file.

 

    <membership>

      <providers>

        <remove name="AspNetSqlMembershipProvider" />

        <add connectionStringName="LocalSqlServer" enablePasswordRetrieval="false"

         enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/"

         requiresUniqueEmail="true" passwordFormat="Hashed" maxInvalidPasswordAttempts="5"

         minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0"

         passwordAttemptWindow="10" passwordStrengthRegularExpression=""

         name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

      providers>

    membership>

 

 

RequiresUniqueEmail property is set to true in the above settings to enable unique email validation.

with 1 Comments