Displaying the E-Mail Address as a Mailto Hyperlink

Recall from Hour 22, “Allowing Users to Add Guestbook Entries,” that when entering a guestbook entry, a user can optionally provide an e-mail address. In Hour 23, “Displaying the Guestbook's Contents,” we displayed this e-mail address, if provided, in the guestbook entry listing (see Figure 24.1).

Figure 24.1. The user's e-mail address, if provided, is displayed.

Rather than just displaying the user's e-mail address as text, it would be nice to display the e-mail address as a mailto hyperlink, which is a hyperlink that has the form

<a href="mailto:emailAddress">emailAddress ...

Get SAMS Teach Yourself ASP.NET in 24 Hours now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.