Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

use HyperLinkColumn to link to an email address

Status
Not open for further replies.

ralphtrent

Programmer
Jun 2, 2003
958
US
Hi
I have a datagrid that display contact info. One of the fields is an email address. I want to make that column in the datagrid linked to an <a href=mailto...>. When i use the HyperLinkColumn type column, it tries to link it to as a page on my site, that is not what I want. Any ides on how to do what I want it to do?

Thanks
 
You can use the TemplateColumn instead:
Code:
<asp:TemplateColumn>
  <ItemTemplate>
    <a href='<%# "mailto:" + DataBinder.Eval(Container.DataItem, "Email") %>'>Click to email</a>
  </ItemTemplate>
<asp:TemplateColumn>
 
what if is not using template and displaying the data as a table? how woutd I do that?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top