1

I am exploring the Membership class of the ASP.net and configuring the roles and users.

Is it a must to set security question in ASP.net administration tool? Because I don't think my system needs the security question.

If I have quite a number of users, how can I import the list of users? I don't want to create users in the administation tool one by one.

2 Answers 2

2

You can change the requirements in the web.config file.

<membership defaultProvider="myProvider" userIsOnlineTimeWindow="20">
        <providers>
            <add 
                name="myProvider" 
                type="System.Web.Security.SqlMembershipProvider" 
                connectionStringName="LocalSqlServer" 
                enablePasswordRetrieval="false" 
                enablePasswordReset="true" 
                requiresQuestionAndAnswer="false"
                applicationName="/" 
                requiresUniqueEmail="false" 
                passwordFormat="Hashed" 
                maxInvalidPasswordAttempts="5" 
                minRequiredPasswordLength="6" 
                minRequiredNonalphanumericCharacters="0" 
                passwordAttemptWindow="10" 
                passwordStrengthRegularExpression=""/>
        </providers>
    </membership>

requiresQuestionAndAnswer="false" is the important bit for your example.

The membership provider API enables you to create users in code. eg Membership.CreateUser You easily use this to write a small utility to import your users from a list.

Sign up to request clarification or add additional context in comments.

Comments

1

you can code a method which loops the users that you want to import and import them one by one with http://msdn.microsoft.com/en-us/library/t8yy6w3h.aspx

you will get a membershipuser object from that method which you can configure further

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.