Essays /

Web Tech Essay

Essay preview

Walkthrough: Creating a Web Site with Membership and User Login A common requirement for Web sites is to allow only some members or other authenticated users to see certain pages. In that case, the application must prompt the user for a name and password. The application must also include a way to hide information from anonymous users (users who are not logged in). This walkthrough shows you how to use ASP.NET controls and ASP.NET membership services to create an application that performs all these tasks. For more information, see Introduction to Membership[->0]. Tasks illustrated in this walkthrough include:

· Configuring an application to include ASP.NET membership services, and how to define users. · Using login controls to get user credentials and to display information to logged-in users. · Protecting one or more pages in your application so that only logged-in users can view them. · Allowing new users to register at your site.

· Allowing members to change and reset their passwords.
Prerequisites[->1]

In order to complete this walkthrough, you will need:
· Microsoft Visual Web Developer.
· Microsoft Internet Information Services (IIS) installed locally on your computer. · SQL Server Express Edition installed locally on your computer. · Access to an e-mail server that can forward e-mail messages. (The server does not have to be able to receive messages.) IIS includes the Default SMTP virtual server, a mail server that is suitable for this walkthrough. For more information about configuring this server. If you are working on a local area network, check with your network administrator for information about access to an e-mail server. Creating the Web Site[->2]

If you have already created a Web site in Microsoft Visual Studio (for example, by working with the topic Walkthrough: Creating a Basic Web Page in Visual Web Developer[->3] ), you can use that Web site and skip to "Configuring Membership" later in this walkthrough. Otherwise, create a new Web site and page by following these steps. To create a local IIS Web site

1. Open Visual Studio.
2. On the File menu, click NewWeb Site.
The New Web Site dialog box appears.
3. Under Visual Studio installed templates, select ASP.NET Web Site. 4. In the Location list box, select HTTP. Click Browse.
The Choose Location dialog box appears.
5. Select Local IIS.
6. Open Local Web Servers.
7. Select Default Web Site.
8. Click the Create New Web Application icon () above the list of Web sites and then name the new Web site membership. 9. Click Open.
The Choose Location dialog box closes.
10. In the Languages box, click the programming language you prefer to work in. The programming language you choose will be the default for your Web site, but you can set the programming languages for each page individually. 11. Click OK in the New Web Site dialog box.

Visual Web Developer creates the Web site and a new page named Default.aspx. Configuring Membership[->4]

Later in this walkthrough you will put pages into a subdirectory that is protected. You must create the subdirectory now so that you can configure security for it later in the walkthrough. To add a new folder to the Web site

1. In Solution Explorer, right-click the name of your Web site and click New Folder. 2. Name the folder MemberPages.
Before you work with ASP.NET membership, you must configure your application to enable membership and to set up users. You can use the Web Site Administration tool, which provides a wizard-like interface for making configuration settings. When you complete the Setup Wizard, a SQL Server database named ASPNETDB.MDF is created in the App_Data folder of the project. For more information. For this walkthrough, you will define a single user.

To create a membership user
1. On the Website menu, click ASP.NET Configuration.
2. Select the Security tab, click the link to Use the security Setup Wizard to configure security step by step, and then click Next. 3. Proceed to Step 2 of the wizard and select the From the Internet option. The wizard displays a page where you can select the authentication method that your Web site will use. This option specifies that your application will use Forms authentication, where users will log in to the application using a login pag...

Read more

Keywords

/default.aspx /en-us/library/k4cbh4dh%28v=vs.90%29.aspx /en-us/library/system.web.ui.webcontrols.login%28v=vs.90%29.aspx /en-us/library/system.web.ui.webcontrols.loginname%28v=vs.90%29.aspx /en-us/library/system.web.ui.webcontrols.loginstatus%28v=vs.90%29.aspx /en-us/library/system.web.ui.webcontrols.loginview%28v=vs.90%29.aspx /en-us/library/system.web.ui.webcontrols.validationsummary%28v=vs.90%29.aspx /en-us/library/system.web.ui.webcontrols.validationsummary.validationgroup%28v=vs.90%29.aspx /en-us/library/yh26yfzy%28v=vs.90%29.aspx /memberpages/members.aspx 0 1 10 11 12 13 14 15 16 17 18 19 2 20 21 22 23 24 25 26 27 28 29 3 30 31 32 33 34 35 36 37 38 39 4 40 41 42 43 44 45 46 47 5 6 7 8 9 abl access accord action activ ad add address administr advanc allow alreadi also although anonym anonymoustempl answer app appear appli applic appropri area asp.net aspnetdb.mdf assum asterisk authent author avail base basic block box brows browser button capabl case certain chang charact check choos clear click close common complet compon comput configur confirm contain content continu continuedestinationpageurl control correct creat createuserwizard credenti ctrl custom data databas default default.aspx defin deni depend design detail determin develop dialog differ display done drag drop drop-down e e-mail earlier edit effect eight enabl enter entri error establish exact exampl exist expand explor express f5 facil file finish first five folder follow form format forward generic get grid group groupof guidelin head help hide home howev http hyperlink icon id ident ii illustr includ individu inform instal instead interfac internet introduct invit item javascript languag later least leav legitim letter like limit link list local localhost locat log logged-in loggedintempl login login.aspx login1 loginnam loginstatus loginview logout long lowercas made mail make mani matter member memberpag members-on members.aspx membership menu messag method microsoft modifi msdn.microsoft.com msdn.microsoft.com/en-us/library/k4cbh4dh%28v=vs.90%29.aspx msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.login%28v=vs.90%29.aspx msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.loginname%28v=vs.90%29.aspx msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.loginstatus%28v=vs.90%29.aspx msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.loginview%28v=vs.90%29.aspx msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.validationsummary%28v=vs.90%29.aspx msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.validationsummary.validationgroup%28v=vs.90%29.aspx msdn.microsoft.com/en-us/library/yh26yfzy%28v=vs.90%29.aspx must name navigateurl need network new newweb next node note number o ok one onto open option order otherwis page panel part password perform permiss person piec point port prefer prerequisit press previous probabl proceed process program project prompt properti protect protocol provid punctuat put question real receiv recipi recogn recov redirect refresh regist register.aspx registr render request requir reset return right right-click role root rout rule run sampl save section secur see select send separ seri server servic set setup show sign simpl singl site skip small smart smtp solut space specif specifi sql standard start state static step store strategi strong studio subdirectori suitabl sure switch tab tag take task team tech templat test text tool toolbar toolbox topic transport tri type typic uppercas use user valid validationgroup validationsummari valu view virtual visitor visual void walkthrough want way web web.config websit welcom whether window without wizard wizard-lik work would yet