Personalizing the To-Do List

It would be nice to allow various members of your family (or office) to keep to-do lists, and to separate the lists based on the users' IDs. So next, you'll create a login form to ask the user to provide an email address and a password. We (the authors) hate being shunted off to a separate page to register, so we'll put the registration form right on the login page. Of course, you don't want the user to see the registration form unless it's needed, so you'll hide it in a collapsible panel that will swing open only if it's needed.

Application with the ability to add items

Figure 6-15. Application with the ability to add items

Confirm the Database Table

Make sure that your database contains the table shown in Figure 6-16. If this isn't the case, please create it now (normally we'd suggest that you use the forms-based security tables for ASP.NET, but for the purposes of this example this is faster).

The users table

Figure 6-16. The users table

Create a DataHelper Class

In this section, you are going to talk the database more. The code that you used earlier in TalkToDatabaseUsingSQLConnectionAndSQLStatement() will turn out to be very handy here. Rather than cutting and pasting, you need to refactor!

Right-click on your web site in the Solution Explorer and select Add ASP.NET Folder → App_Code, as seen in Figure 6-17.

Figure 6-17. Adding ...

Get Programming .NET 3.5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.