Discussion:
Gridview hyperlink column mailto event
(too old to reply)
Marcial
2004-12-28 20:37:04 UTC
Permalink
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,
--
Application Engineer / DBA
UCLA SOM
Vikesh Arora
2004-12-29 17:07:53 UTC
Permalink
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>
Post by Marcial
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,
--
Application Engineer / DBA
UCLA SOM
Marcial
2004-12-29 23:45:05 UTC
Permalink
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!!
Post by Marcial
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,
--
Application Engineer / DBA
UCLA SOM
Loading...