WARNING AND NOTICE

All tricks in this blog are only for educational purpose. Learn these tricks only for your knowledge. Please donot try these to harm any one. We will not take any responsibility in any case. All softwares and tools on this site are here for private purposes only and If you want to use a software for business purpose, please purchase it. I do not host many of these tools. I Post links that I have found from numerous Search engines. I will not be responsible for any of harm you will do by using these tools.

Readmore

Thursday, September 23, 2010

Lab 4: ASP.NET 2.0 Membership, Login Controls, and Role Management

Forms authentication is a popular means of securing Internet applications. In ASP.NET’s brand of forms authentication, you designate a login page for logging in unauthenticated users and use URL directives to specify which pages require logins and which ones do not. When an anonymous (that is, unauthenticated) user attempts to access a page that’s only available to authenticated users,ASP.NET automatically redirects them to the login page.ASP.NET 1.x simplified forms authentication by introducing declarative means for designating login pages and specifying authorization rules. ASP.NET 2.0 further simplifies forms authentication by providing the following facilities:A membership service for managing users and user credentials Login controls for logging in users, creating new users, and more A role management service for enacting role-based security In this lab, you’ll use all three to build a secure administrative interface for the My Comics application. You’ll begin by creating a login page. Then you’ll secure the admin page you created in Lab 2so that only authenticated users can access it, and add links to the master page for navigating to the admin page and logging in. Finally,you’ll use role-based security to tighten permissions on the admin page so that only administrators can access it. Add a login page In this exercise, you’ll create a login page that includes a Login control for logging in existing users and a Create User Wizard control for registering new users. Tasks Detailed Steps 1. Open the Web sitea. Start Microsoft Visual Studio and use the “File->Open Web Site” command to open the C:\MSLabs\ASP.NET\Starter\\Lab4 site. 2. Add a page to the Web site a. Right-click C:\..\Lab4 in Solution Explorer and use the “Add New Item” command to add a page named Login.aspx. Choose “Web Form” as the template type and check the “Place code in separate file” and “Select master page” boxes. Before clicking the Add button, be sure C# or Visual Basic is selected in the Language box. b. When asked to pick a master page, select Site.master.c. Change Title=“Untitled Page” to Title=“My Comics Login” in Login.aspx’s @ Page directive. d. Click the Design button to switch to Design view.

Download Lab 4: ASP.NET 2.0 Membership, Login Controls, and Role Management.

0 comments:

Post a Comment