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

Posted on 2007-08-06
Last Modified: 2008-02-26
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.
Question by:brotherbill999
    LVL 29

    Accepted Solution

    You put the info in your web.config as shown here
    LVL 4

    Expert Comment

    you have to configure that in the web.config file

    Author Comment

    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...

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

                <roleManager enabled="true"/>
                <membership defaultProvider="AspNetSqlMembershipProvider">
                            <remove name="AspNetSqlMembershipProvider"/>
                            <add connectionStringName="LocalSqlServer"
                 type="System.Web.Security.SqlMembershipProvider, System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
    LVL 29

    Expert Comment

    Are you using visual studio 2005?
    Have you looked at the "login" controls under the toolbox?

    Author Comment

    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
    LVL 29

    Assisted Solution

    You would relay the email to an smtp server on your domain (or on the web server itself)
    Take a look here...
    LVL 4

    Assisted Solution


                      <smtp from="">
                            <network host=""/>


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now