ASP:HyperLink & Mailto

Recently I had a bit of trouble getting the HyperLink control to push out a mailto link in a Details View.

<asp:HyperLink NavigateUrl=’mailto:’ Text=’<%# Bind(”Email”) %> runat=”server” ID=”hlEmail”></asp:HyperLink>

 

This leaves a hyperlink but with a blank mailto - i.e. test@techtoolblog.com

So I assume if I stick in the bind (or eval) text to the Navigate URL we should be good to go:

<asp:HyperLink NavigateUrl=’mailto:<%# Bind(”Email”) %> Text=’<%# Bind(”Email”) %> runat=”server” ID=”hlEmail”></asp:HyperLink>

 

This gives me a link that is NOT clickable - If I view the source I see

<a id=”Details_hlEmail” href=”mailto:&lt;%#%20Bind(&quot;Email&quot;)%20%>”>test@techtoolblog.com </a>

 

My next guess is that this has something to do with formatting string, sure enough it is: This is the solution that ended up working for me:

<asp:HyperLink NavigateUrl=’<%# Bind(”Email”, “mailto:{0}”) %> Text=’<%# Bind(”Email”) %> runat=”server” ID=”hlEmail”></asp:HyperLink>

Written by Tim on August 15th, 2007 with 15 comments.
Read more articles on asp.net.



Related articles

15 comments

Read the comments left by other users below, or:

Get your own gravatar by visiting gravatar.com asp.net ecommerce
#1. April 1st, 2011, at 10:31 AM.

I am glad to have found such an informative post. As a beginner in asp.net, this post is really very useful to me, so I would like to keep visiting this site often.

Get your own gravatar by visiting gravatar.com rosetta stone spanish
#2. April 13th, 2011, at 3:01 PM.

Oh I love all of these! Especially because they are so simple and beautiful yet have a cool edge.

Get your own gravatar by visiting gravatar.com Hermes Bags
#3. April 26th, 2011, at 2:53 AM.

Hermes Bags
http://www.hermesfantasy.com/
Hermes Bags

Get your own gravatar by visiting gravatar.com replica John Galliano jewelry
#4. May 13th, 2011, at 6:40 AM.

heihie !!!!!!!
my famous star!

Get your own gravatar by visiting gravatar.com Seo Sydney
#5. May 17th, 2011, at 4:55 AM.

I am thankful to the fine article providing the quality information related to the finding of HyperLink & Mailto. I have found many new things. I appreciated it. Thanks..!
Seo Sydney

Get your own gravatar by visiting gravatar.com learn a language
#6. May 18th, 2011, at 2:18 AM.

ul to the fine article providing the quality information related to the finding of Hyp

Get your own gravatar by visiting gravatar.com Rackmount LCD
#7. May 20th, 2011, at 9:33 AM.

I admire the valuable information you offer in your articles. I will bookmark your blog and have my friends check up here often. I am quite sure they will learn lots of new stuff here than anybody else!

Get your own gravatar by visiting gravatar.com lebron james shoes
#8. May 27th, 2011, at 9:25 AM.

http://www.nbashoessale.com/

Get your own gravatar by visiting gravatar.com Jane
#9. May 27th, 2011, at 9:22 PM.

Thank-you! Thank-you! Thank-you! Thank-you! :)

Get your own gravatar by visiting gravatar.com Southampton Internet Marketing
#10. May 30th, 2011, at 12:37 PM.

I Read your ASP Tips. It is great Helpful for me. Thanks

Get your own gravatar by visiting gravatar.com service video
#11. June 9th, 2011, at 5:06 AM.

I visit your blog. Your blog is very much good. I am very much impressed by your blog content; I also come across number of sites, you can also check these are also very much useful for everyone. Thanks for sharng. Good work.
service video

Get your own gravatar by visiting gravatar.com Gucci Belt Bag
#12. June 14th, 2011, at 2:22 AM.

good time

Get your own gravatar by visiting gravatar.com cheap handbags
#13. June 20th, 2011, at 1:11 AM.

A great post but How to select a cool handbags. we sell cheap handbags We are the best store provided various cheap designer handbags but only a little white to make coach handbags online

Get your own gravatar by visiting gravatar.com Rosetta Stone French
#14. July 1st, 2011, at 3:15 AM.

Thanks so much for your share !
Thank you for sharing so wonderful post !
You know, that is a great deed. I love here so much. Waiting for your next wonderful post!
Hey, you are so amazing. I like it. Thank you.
Good blog! I really love how it’s easy on my eyes as well as the data are well written.
I am wondering how I could be notified whenever a new post has been made.

Rosetta Stone French

Get your own gravatar by visiting gravatar.com jack wills
#15. September 24th, 2011, at 11:23 AM.

Many thanks for being the teacher on this niche. I actually enjoyed your own article quite definitely and most of all enjoyed reading how you really handled the areas I considered to be controversial. You are always extremely kind to readers like me and help me in my life.

Leave your comment...

If you want to leave your comment on this article, simply fill out the next form:




Anti-Spam Protection by WP-SpamFree

You can use these XHTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong> .

Famous Homemade Soups