Personalization Using Visual Basic 2005 - Creating the Welcome Page
(Page 4 of 6 )
With your user database in place, you are ready to create the page that will welcome the logged-in user.
Create a new page called Welcome.aspx and drag aLoginStatuscontrol from the Login section of the Toolbox.
A link marked Login is placed on the page, whose smart tag indicates that you are looking at the template for when the user is not logged in, as shown in Figure 12-11.

Figure 12-11. Not logged in
You can set the properties of theLoginStatuscontrol, for example, to change the text of the link. You can also drop down the view window to see the link and text for Logged In status.
Drag aLoginViewcontrol from the Toolbox, and drop it onto the page below theLoginStatus control. Here you may enter text and controls that will be displayed based on whether or not the user is logged in. Notice that this control has two views: Anonymous Template and Logged In Template. The template that will be displayed depends on whether the user has logged in.
Click on the smart tag and confirm that the view is set to Anonymous Template and type some text in the box, as shown in Figure 12-12.

Figure 12-12. Not logged in view
Now set theLoggedInTemplate. Since the user will be logged in when this template is displayed, you can use theLoginNamecontrol to welcome the user by name. Drag theLoginNamecontrol onto theLoginViewtemplate, as shown in Figure 12-13.

Figure 12-13. The LoginName control
Next: Create a Login Page >>
More Visual Basic.NET Articles
More By O'Reilly Media
|
This article is excerpted from chapter 12 of the book Programming Visual Basic 2005, written by Jesse Liberty (O'Reilly, 2005; ISBN: 0596009496). Check it out today at your favorite bookstore. Buy this book now.
|
|