Wednesday, January 9, 2008

How do I add mailto: to Hyperlink control in GridView, DataList, DetailsView, etc…?

In our practical coding life, we have to display email address inside the ASP.NET data controls like GridView, DataList, DetailsView, etc… Actually, we can display (Bind/Eval) the email address with Hyperlink just as Text. But with field like email address, we should add the mailto: tag. Then customer can just click on email address and call the default local email client to send an email.

With ASP.NET you can do it with simple modification. But make sure not to add only mailto: (concatenate) with email address. You must format the string with email address like below.

FAQ00009

Labels:

0 Comments:

Post a Comment

<< Home