Link to home
Start Free TrialLog in
Avatar of brotherbill999
brotherbill999

asked on

How to configure new website to use aspnetdb for membership/login

For ASP.NET 2.0, can create SQL Server 2000 database aspnetdb using aspnet_regsql.exe wizard.
The problem is how to configure a new ASP.NET 2.0 website to recognize this database for membership and login.
ASKER CERTIFIED SOLUTION
Avatar of QPR
QPR
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
you have to configure that in the web.config file
Avatar of brotherbill999
brotherbill999

ASKER

That was a good start, so now I have a partial victory.

I can build aspnetdb, have passwordFormat="Clear" for clear text passwords, add a user and log in a user.

Here's what I can't do...
  1. Have the LoginStatus correctly indicate log in or log out
  2. Have the LoginName correctly indicate the userid or empty
  3. change the password, minRequiredPasswordLength="4",             minRequiredNonalphanumericCharacters="0", so this is a very lenient password.  It always gripes.
  4. send an email (how do I configure that?).

partial web.config...

      <connectionStrings>
            <remove name="LocalSqlServer"/>
            <add name="LocalSqlServer" connectionString="Data Source=BROTHERBILL;Initial Catalog=aspnetdb;User ID=sa;Password=masterkey" providerName="System.Data.SqlClient"/>
      </connectionStrings>

      <system.web>
            <roleManager enabled="true"/>
            <membership defaultProvider="AspNetSqlMembershipProvider">
                  <providers>
                        <remove name="AspNetSqlMembershipProvider"/>
                        <add connectionStringName="LocalSqlServer"
             name="AspNetSqlMembershipProvider"
             enablePasswordRetrieval="true"
             enablePasswordReset="false"
             applicationName="/"
             requiresUniqueEmail="false"
             passwordFormat="Clear"
             maxInvalidPasswordAttempts="5"
             minRequiredPasswordLength="4"
             minRequiredNonalphanumericCharacters="0"
             passwordAttemptWindow="10"
             passwordStrengthRegularExpression=""
             requiresQuestionAndAnswer="false"
             type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
                  </providers>
            </membership>
Are you using visual studio 2005?
Have you looked at the "login" controls under the toolbox?
Yes, I am using Visual studio 2005.
And yes, I am using the "login" controls under the toolbox.

And yes, I left something out.
Changed   <authentication mode="Windows"/>   (the default)
to             <authentication mode="Forms"/>

This solved all the problems except where the user requests emailing their password.
In the PasswordRecovery control, set properties: "From" to my email and "Subject" to "Your lost password"

Error when requesting a new password is: "The SMTP host was not specified."
So now the question is: How do I specify the SMTP host for the PasswordRecovery control?

Thank you
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial