0

In my app I want to enable login with email or username. I found this solution , which is extending the simpleMembershiProvider. In this solution there is stated, that I have to register this new membership provider in web.config file but I am unable to find any guide how to do it, so I would be thankful for any instructions how to register the extended provider or for any other solution how to enable login with email or username.

Thank you in advance.

Community
  • 1
  • 1
marek_lani
  • 3,895
  • 4
  • 29
  • 50

1 Answers1

1

Add this to your web.config under System.Web and tweak the settings in that configuration to match your requirements.

<membership defaultProvider="AccountMembershipProvider">
  <providers>
    <clear/>
    <add name="AccountMembershipProvider" type="Yourcustomclasswithnamespace" connectionStringName="yourdatabaseconnectionstringname" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="yourappname"/>
  </providers>
</membership>
Slack Shot
  • 1,090
  • 6
  • 10
  • thanks for your answer unfortunetely I am getting error: "This method cannot be called during the application's pre-start initialization phase." on line – marek_lani Sep 18 '13 at 15:24
  • Ok I guess I find an answer http://stackoverflow.com/questions/4626647/asp-net-this-method-cannot-be-called-during-the-applications-pre-start-initial – marek_lani Sep 18 '13 at 15:25