Gridview hyperlink column mailto event

G

Guest

Hello,

I have a ASP.NET 2.0 coding issue I need help with.

I have a Gridview which displays the Name and e-mail address columns of an
underlying SQL datasource.

I added a hyperlink field to the columns collection.

I'm trying to figure out how to send an email after the email address link
is populated.

Simply placing "mailto:" in the DataNavigateFormatString property launches
my mail client, but the selected addess is not transferred into the TO: filed.

Thanks,
 
V

Vikesh Arora

Hi

if you have added the template column in the GridView,

what u can do if email is your column name

intead of using the <asp:hyperlink, you can use the traditional HTML control

<TemplateColumn HeaderText="Send Email">
<ItemTemplate><a href="mailto:<%#
Databinder.Eval(Container.DataItem,"email")%>"><%#
Databinder.Eval(Container.DataItem,"email")%></a>
</ItemTemplate>
</TemplateColumn>
 
G

Guest

First of all many thanks to Vikesh for the reply.
It helped a lot.

I still wonder if there is a way to do the same thing with .NET 2.0.

Next I'll need to figure out how to send a URL link to a document in the
body of the e-mail... or better yet, insert an attachment from a dropdown
list of documents.

Happy New Year All!!
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top