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

  • Thread starter Thread starter Paolo
  • Start date Start date
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!
 
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,
 
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!
***********************************************
 
Back
Top