Wednesday, September 5, 2012

mailto: from HyperLink to allow the user to send emails

Hyperlink Control for mailto: to be used like this anywhere in the page
 
<asp:HyperLink ID="HyperLink1" runat="server" Text='<%# Eval("EMail") %>'
     NavigateUrl='<%# Eval("EMail", "mailto:{0}") %>'></asp:HyperLink>
 
HyperLinks in the GridView Row link use as Mailto:

 
<asp:TemplateField HeaderText="EMail" SortExpression="EMail">
    <ItemTemplate> 
         <asp:HyperLink ID="HyperLink1" runat="server" 
            NavigateUrl='<%# Eval("EMail", "mailto:{0}") %>' 
            Text='<%# Eval("EMail") %>'></asp:HyperLink>
     </ItemTemplate>
</asp:TemplateField>

No comments:

Post a Comment