Home   Preview the Book   Chapter 15, TOC   Part 21

  Previous: Using Session State to Remember Previous Links
  Next: Localizing Graphic Effects

Using Authentication to Vary the Display

To conclude our presentation of the breadcrumb custom control, we need to mention one other feature. As Figure 15-13 shows, a logged-in visitor can also log out directly from the breadcrumbs control. If the visitor is not logged in, the logout link is replaced by a link to log_in.aspx.

To determine whether to display the logout link or the login link, the Render method checks the Page.User.Identity.IsAuthenticated property. An authenticated visitor gets the logout link, and an unauthenticated visitor gets the login link.

The controls presented to this point comprise all those that appear in all of the VB Snippets Web pages. A control does not have to appear in every page to be useful, however. Let’s look now at a more specialized control.

  Previous: Using Session State to Remember Previous Links
  Next: Localizing Graphic Effects

Home   Preview the Book   Chapter 15, TOC   Part 21

Copyright © 1996 - 2017 SoftMedia Artisans, Inc. All Rights Reserved.