LoginControl Example In Asp.Net To Create Login Page

LoginControl Example In Asp.Net 2.0 3.5 4.0 To Create Login Page Using Membership Provider DataBase ASPNETDB.MDF.

Login Control Example In Asp.Net
Create a new website and add new web form in the solution, name it Login.aspx,

Drag and place a Login control on this page from toolbox in visual studio.

Assign DestinationPageUrl property of Login control to the page we want to open after login, i m redirecting to Default.aspx page.

<form id="form1" runat="server">
<asp:Login ID="Login1" runat="server" 

Place a LoginStatus and LoginName control on Default.aspx page to display username and logout hyperlink.

<form id="form1" runat="server">
 <asp:LoginStatus ID="LoginStatus1" runat="server" />
 <asp:LoginName ID="LoginName1" runat="server" />

Now we need to configure our website or application to use membership provider database to authenticate user login credentials.

For this Click on website menu of visual studio and select ASP.NET Configuration.

Asp.Net membership provider website configuration

Click on Security Tab and click on Use the security Setup Wizard to configure security step by step link.

Security configuration

Click next on welcome screen And Select From the internet option in next screen.

access method

Click next and reach to step 5 to create new user, enter username and password and other informations and click on create user.

create new user

In next screen Select Anonymous User radion button and then select deny permission, click on add this rule to dent anonymous access to site.

deny anonymous access

CLick on finish to complete asp.net membership provider configuration.

This will autometically add ASPNETDB.MDF database in App_Data Folder.

Build and run the application, login with the credentials used in creating new user in configuration.

If you like this post than join us or share


android black jack said...

Very nice information you have shared......... i like this.....

Find More Articles