mailto in hyperlink field of datagrid

J

jdw

I have seen sample code to add mailto feature in datagrid hyperlink
field using the RowDataBound event.

I did it a bit different. e-amil address are stored in a database.
(e-mail address removed).

I created a derived field in my select statement select 'mailto:' +
. from table. I converted the hyplerlink to a template field. I
then edited the source as follows.


<ItemTemplate>
<asp:HyperLink ID="HyperLink1" runat="server"
NavigateUrl='<%#Bind("mailto") %>' Text="E-Mail"></asp:HyperLink>
</ItemTemplate>

This is working for me.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,438
Messages
2,571,698
Members
48,796
Latest member
Greg L.
Top