Skip Navigation LinksASP.Net 2.0 Training : Login Controls 1
Banner for ASP.Net 2.0 training classes in Visual Basic 2005 

Skip Navigation Links
Visit my other site:

certification training

Free Flash tutorials and training

Free Dreamweaver Video Tutorials

Free PHP Training

Visual Basic Windows Training




If you like this site please link to it


Login Controls


ASP.Net uses Membership to create users, authenticate users and change user settings by default

Login Controls:
Login Control – Login form
CreateUserWizard – user registration form
LoginStatus – login or logout link
Loginname – display username
ChangePassword – allows the user to change their password
PasswordRecovery – allow the user to retrieve their password
LoginView – Display content depending on logged in or out


Web.Config

Web applications are set up for Windows authentication by default
You must change it to forms authentication

Login Control

Create a new folder

Name it PrivateFiles

With the folder selected, add a new webform, name is secretpage.aspx

Write This is the secret page on this page
First we will password protect the page and all other page sin this folder
Make sure authentication Mode is set to forms in the web.config in the root folder

Add a web.config file to the folder

To restrict users from viewing the contents of a folder you must configure the authorization of the folder
Add the following code
<authorization>
   <deny users=”?” />
</authorization>

Now if you attempt to request any file in the PrivateFiles folder you will be redirected to login.aspx

Next you have to create the Login.aspx page
Add a login control and save the page

Create another page named CreateUser.aspx

Run this page and create a new user

This automatically creates a SQL Server Express database and puts it in the App_Data folder

Now run the secretpage and it will redirect you to the login page. Enter your username and password and you will go back to the secret page.


Login Properties
You can change the text in the login control

Failuretext is the text displayed when you login incorrectly
Instructiontext is the directions given to the user to login


Modifying the CreateUserWizard control
You can set the CreateUserWizard control so it does not ask for an email by setting the RequireEmail to false


      ASP.Net 2.0 tutorials & training