Q:

how to set asp:HyperLink href to "mailto:abc@hotmail.com" in .net c#

Does anyone know how can I set the asp:HyperLink href to "mailto:abc@hotmail.com" in .net c#?
Example:
If I have the following code:
  <tr>
    <td class="graytext r">PERSONAL EMAIL:</td>
    <td><asp:HyperLink runat="server" ID="sPersonalEmail" class="orange" style="cursor:pointer" /></td>
  </tr>

How can I set the href to "mailto:abc@hotmail.com" in .net c# instead of hard code it in asp:HyperLink?

A:

Something like this by setting NavigateUrl:
<asp:HyperLink runat="server" NavigateUrl='<%# Bind("Email", "mailto:{0}") %>'
                              Text='<%# Bind("Email") %>'
                              ID="hlEmail">
</asp:HyperLink>

A:

I find this the easiest
string whateverEmail = "test@this.com";

hypEmail.Attributes.Add("href", "mailto:" + whateverEmail );

