• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 428
  • Last Modified:

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.
0
brotherbill999
Asked:
brotherbill999
  • 3
  • 2
  • 2
3 Solutions
 
QPRCommented:
You put the info in your web.config as shown here

http://aspnet101.com/aspnet101/tutorials.aspx?id=63
0
 
ki_kiCommented:
you have to configure that in the web.config file
0
 
brotherbill999Author Commented:
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>
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
QPRCommented:
Are you using visual studio 2005?
Have you looked at the "login" controls under the toolbox?
0
 
brotherbill999Author Commented:
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
0
 
QPRCommented:
You would relay the email to an smtp server on your domain (or on the web server itself)
Take a look here...
http://msdn2.microsoft.com/en-us/library/ms178335.aspx
0
 
ki_kiCommented:
<configuration>
.
.
.
.

<system.net>
            <mailSettings>
                  <smtp from="someAddress@myCompany.com">
                        <network host="email.myCompany.com"/>
                  </smtp>
            </mailSettings>
</system.net>

</configuration>
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now