Basic steps for using. NET 2.0 Membership Management

Source: Internet
Author: User
Tags connectionstrings

. NET 2.0 provides membership management, and this article briefly describes the basic steps for using membership management.
1. Create a database using Aspnet_regsql
Open Visual Studio Command Prompt, enter aspnet_regsql, create ASPNETDB Database from the wizard, and save user information.
Change configuration in 2.web.config file
<connectionStrings>
<add name= "sqlservices" connectionstring= "Data source= (local); Integrated security=sspi;initial;" />
</connectionStrings>
<system.web>
<membership defaultprovider= "SQLProvider" userisonlinetimewindow= ">"
<providers>
<add name= "SQLProvider" type= "System.Web.Security.SqlMembershipProvider" connectionstringname= "Sqlservices" Enablepasswordretrieval= "false" enablepasswordreset= "true" requiresquestionandanswer= "true" Passwordformat = " Hashed "applicationname="/"/>
</providers>
</membership>
</system.web>
3. Select Web site/asp.net configuration, you can make some manual configuration of membership.
4. Create Newuser.aspx page, add CreateUserWizard control to this page
<asp:createuserwizard id= "CreateUserWizard1" runat= "Server" >
<WizardSteps>
<asp:createuserwizardstep runat= "Server" >
</asp:CreateUserWizardStep>
<asp:completewizardstep runat= "Server" >
</asp:CompleteWizardStep>
</WizardSteps>
</asp:CreateUserWizard>
5. Create the Login.aspx page, add the login control to the page, set the Createusertext and Createuserurl properties
<asp:login id= "Login1" runat= "Server" createusertext= "Create New User" createuserurl= "~/newuser.aspx"
Destinationpageurl= "~/default.aspx" >
</asp:Login>
6. Add LoginStatus and LoginName controls to the Default.aspx page
<asp:loginstatus id= "LoginStatus1" runat= "Server"/>
<asp:loginname id= "LoginName1" runat= "Server"/>
7. Set the Login.aspx as the starting page for testing.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.