Using the ASP.Net Login control in umbraco

The following is a step by step guide to using the ASP.Net login control in umbraco.

Step 1

Create a new DocType and associated template called Login Example.

Login Example Screen 1

Step 2

Go to the new Login Example template and add the form tag and login control code as shown below.

Screen shot 2010-01-08 at 15.53.49

Step 3

Now go to the content node and create a page called Login using the 'Login Example' docType.  If 'Login Example' docType is not available ensure you have it as an allowed child node of the parent docType.

Login Example Screen 3

Step 4

Now you can view your new login page!Login Example Screen 4

Step 5

To use your login page you will need to go to the Members section and create a member type.  This must be created before you try and create your first member.  Also, if you plan to use the createUserWizard control you will need to update your web.config as per my previous post to reference this member type.

Login Example Screen 5

Step 6

Now you can create your user.

Login Example Screen 6

Step 7

The final step in the whole process is to secure the portion of the site that you want to be members only.  To do this go to the content node you want to secure, right click and choose 'Public Access'  This will then give you the option to choose 'User Based' or 'Role Based' security.  Once you select one of these options you will then be prompted to choose your Login page (just select the login page node from the tree) and the error page which will be displayed if a user is valid, but doesn't have sufficient privileges.

1 comment for “Using the ASP.Net Login control in umbraco”

  1. Gravatar of Paul MardenPaul Marden
    Posted Monday, January 11, 2010 at 6:05:46 AM

    Thanks for this -- it's really useful. Perhaps you could copy it onto our.umbraco.org

    Cheers

    Paul