In the tutorial at the end of Chapter 23, you created Web pages that could add, delete, and update records in the Cosmopolitan Farmer database. You wouldn’t want to allow just anyone who visits the Web site to access these pages, let alone delete ads from the site.
Unfortunately, Dreamweaver doesn’t include any tools for adding password protection to ASP.NET pages. For a list of resources covering how to add password protection using ASP.NET, see page 728.
The following steps assume that you’ve worked through the tutorial in Chapter 23, and have all of the completed files ready to go. You’ll build on them in the following steps.
The first step is to create a login page—a simple form with fields for a user name and password. After a successful login from this page, an administrator will be able to access the administration pages.
Open the file login.asp in the admin folder of the site.
This page will contain the form for typing in an administrator’s user name and password. You’ll add the form next.
Choose Insert → Form.
Dreamweaver adds a red dashed line to the page, indicating the beginning and ending <form> tags.
In the Property inspector, type login as the name of the form.
While this step isn’t required, it’s good to get into the habit of giving your forms helpful names.
In the document window, click inside the red dashed lines and type Username:
This is the label for the form field you’ll add next.