Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com�s entire library of video tutorials.
Now let's handle session management for our ToDo web application. We'll open the session object and add a couple of new properties. User name for the current user, and ToDo DB to point to the database. Now we'll add a new login page. When the user clicks the login button, we will save the user name in the session. We will then transfer control to the ToDo page. On the ToDo page we will set this welcome label to be the name of the user. We do this in the shown event of the ToDo page. It is called when the page is shown in the web browser. In the application let's change our default web page to be the login page. Now let's run the project. The user name can be anything, and you can see it now says the [00:02:58 ] name that was typed, and the ToDo page appears. The next thing we want to do is have the session connect to the database. If we go back to our ToDo project, you'll recall that we put all the database code in the database controller module. It would be great to re-use this, so let's copy this into our web application. We no longer need this property because we are storing the database connection in the session. We won't be able to display message boxes from within a module in a web application, so we will comment this line out. We need to copy the SQL into this project. Next we'll need to re-name all the instances of the ToDo Global variable to be session dot ToDo. We can do this with search and replace. We'll select all the rows we want to change, and replace them. Let's analyze this item and see if there is anything else we need to fix. We need to add the app name constant to the app class. Now let's go back to our login page. Here we want to connect to the database. And if we can successfully connect we will show the ToDo page. Let's run this. That appears to have worked.
| Course: | Real Studio |
| Author: | Paul Lefebvre |
| SKU: | 34190 |
| ISBN: | 1-936334-77-1 |
| Release Date: | 2011-02-02 |
| Duration: | 7 hrs / 87 lessons |
| Work Files: |
Yes |
| Captions: | No |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |