Create a Mailto: link from a SQL Database with asp.net 2.0

P

Paolo

While it is not a problem to create a mailto link in HTML,

<a href=

mailto: said:
<%#DataBinder.Eval(Container.DataItem, "StoreEmail")%></a>

I would like to do so using an ASP.Net 2. 0 hyperlink, or some other control
(in Visual Web Developer 2005). What is the best way to do so?

TIA!
 
D

Danny Tuppeny

Paolo said:
While it is not a problem to create a mailto link in HTML,

<a href=



I would like to do so using an ASP.Net 2. 0 hyperlink, or some other control
(in Visual Web Developer 2005). What is the best way to do so?

TIA!

If you bind the property directly to your field, then choose "Custom
binding" and add '"mailto:" + ' to the beginning. Here's an example of a
link where I wanted to use the ID from a database, but have the filename
hard-coded in the page:

http://dantup.me.uk/tmp/bind.jpg

HTH,
 
C

Cowboy \(Gregory A. Beamer\)

1. Drag a hyperlink control on the page.
2. Set NavigationURL in the code

VB.NET
Hyperlink1.Text = "Click this to mail me"
Hyperlink1.NavigationUrl = "mailto:[email protected]"

C#
Hyperlink1.Text = "Click this to mail me";
Hyperlink1.NavigationUrl = @"mailto:[email protected]";

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***********************************************
Think Outside the Box!
***********************************************
 

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

Top