Free templates
Menu Search Free templates

Login and password protection with Forms Authentication (C#, VB and ASP.NET) | Free code

Here you can download free code (C# and VB) to create a website with login and password protection by applying the functionality of Forms Authentication in ASP.NET.

On a website where users should be able to register as users to add custom content or to gain access to certain information, there must be a form to sign in to the website and code that protects content from unauthorized visitors. This template with free code for login and password protection makes it possible for you to create a website that can be tailored to registered users and that can help protect some or all content from unauthorized visitors.

This template with free code (C# and VB) for sign in and password protection with Forms Authentication includes a web page for login, a web page to register for an account, a web site with protected content for registered user and a web page of protected content for administrators.

The form for registering as a user require information about the user in particular username and password, this information is stored in a table of users after the button on the form is clicked. Passwords in this template is encrypted with SHA1 and saved as encrypted passwords in the database. When a user want to log in is there a check between the password that the user entered encrypted with SHA1, and the encrypted password in the table for the user in accordance with the given username.

If the comparison between the passwords is correct will a cookie be created with information in a Form Authentication Ticket that allows the user to get permission to see a password-protected web page. The information included in a Form Authentication Ticket can be retrieved and that is exactly what is being done in the password-protected website. In our Forms Authentication Ticket have we also saved information about if the user is an administrator or not, and this information can we use to protect content from users who are not administrators.

If you want to send additional information to the password-protected website, for example "User ID", then it is possible to send such information as a parameter in the URL, or by storing information in a session variable.

Remember that you in your web hosting account must have made a setting for the correct version of "ASP.NET" on your website (the version listed in the "Web.config" file). We are using Visual Web Developer 2005 (2010) Express Edition for web programming.
Updated: 01/01/2015 | Created by All-templates.biz

Download Login and password protection with Forms Authentication (C#, VB and ASP.NET) | Free code ยป

Tags: web code password protection