473,395 Members | 1,341 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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

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

<a href=

"mailto: <%# Databinder.Eval(Container.DataItem,"StoreEmail") %>"
<%#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!


Nov 30 '05 #1
2 3906
Paolo wrote:
While it is not a problem to create a mailto link in HTML,

<a href=

"mailto: <%# Databinder.Eval(Container.DataItem,"StoreEmail") %>"
><%#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!


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,
Nov 30 '05 #2
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:so*****@somewhere.com"

C#
Hyperlink1.Text = "Click this to mail me";
Hyperlink1.NavigationUrl = @"mailto:so*****@somewhere.com";

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

***********************************************
Think Outside the Box!
***********************************************
"Paolo" <Pa************@TheCornerStore.com> wrote in message
news:Av******************@fe08.lga...
While it is not a problem to create a mailto link in HTML,

<a href=

"mailto: <%# Databinder.Eval(Container.DataItem,"StoreEmail") %>"
<%#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!

Nov 30 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Bill Petrol | last post by:
I'm trying to send a link with a querystring as the body of an email message. My HTML syntax looks something like this: <a href="mailto:xxx@yyy.com?Subject=<? print $subject ?>&Body=<? print...
3
by: Peter Bassett | last post by:
I have a recruiter website listing jobs. Some postings having email links directly to the employer (instead of the usual email link to the recruiter owner). The owner wishes to track when people...
15
by: nAmYzArC | last post by:
Hi everyone, I'm setting the body of an email using values from a form firstname = bob lastname = dole ebody = 'First Name: ' + firstname + '\r\n' + 'Last Name: ' + lastname ...
12
by: ElvisIsDead | last post by:
Have a script that takes a form and emails it automatically. Here is the part: <form onSubmit="return editData();" name="estm" enctype="text/plain" method="post"...
18
by: Shinin | last post by:
I am trying to set up a mailto: link so that the actual address that the email is being sent to is obscured and replaced by a name. For example, I have <a href="mailto:jschmoe@abc.com">Joe...
5
by: Olaf | last post by:
I have a ASP page that after saveing data to the database it will write the following script code to the page: <script>...
12
by: catyionic | last post by:
hi, Due to trying many different form options, with none of them working, I opted for this to receive info back from this site: http:\\www.elderslastwish.com <form name="feedback_form"...
15
by: tshad | last post by:
I am trying to put an persons email address in a response I am sending another person. I can get it to work by doing the following: message.Body = resumeTop & vbCrLf & vbCrLf & "For Applicant:...
2
by: zamuel | last post by:
I have fairly simple problem. I have a form which shows email address from database on label called 'email'. This address shows as a mailto link, which opens outlook normally. Because the address...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.