473,473 Members | 2,169 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

using mailto in a button click event

Not being an web programmer I am unable to figure out how to put the
hyperlink mailto:emailaddress in a button click event. I do not want a
hyperlink on the form. I have found nothing to address this. using
response.redirect is not the answer because you do not return to the page
with the button on it.
Also, is it necessary to encode the address and if yes, how to do that, please

Thanks. I am sure this is very simple but I am a windows programmer not used
to links, html, etc.
--
smHaig
Mar 2 '06 #1
3 18926
That's client-side stuff.
Add an onclick handler to a simple html button, not
a server control, like so: onclick="return OpenMail();"

Then in the javascript on the page, in
client-side script tags, best in the html header:

<script type="text/javascript">
function OpenMail()
{
location.href = "mailto:he**@help.net";
return false;
}
</script>

That should do it.
No encoding should be necessary.

"smHaig" <sm****@discussions.microsoft.com> wrote in message
news:71**********************************@microsof t.com...
Not being an web programmer I am unable to figure out how to put the
hyperlink mailto:emailaddress in a button click event. I do not want a
hyperlink on the form. I have found nothing to address this. using
response.redirect is not the answer because you do not return to the page
with the button on it.
Also, is it necessary to encode the address and if yes, how to do that, please
Thanks. I am sure this is very simple but I am a windows programmer not used to links, html, etc.
--
smHaig


Mar 2 '06 #2
I have used your suggestion which seems clearly the right way, but I have
this error:
handles clause requires withevents qualifier.

where would this go? on the function heading. Or is there a withevents
needed and where would that go?
--
smHaig
"smHaig" wrote:
Not being an web programmer I am unable to figure out how to put the
hyperlink mailto:emailaddress in a button click event. I do not want a
hyperlink on the form. I have found nothing to address this. using
response.redirect is not the answer because you do not return to the page
with the button on it.
Also, is it necessary to encode the address and if yes, how to do that, please

Thanks. I am sure this is very simple but I am a windows programmer not used
to links, html, etc.
--
smHaig

Mar 2 '06 #3
I had spoken to soon. The problem was that I failed to remove the button
click event for the asp button that I removed when I instead used the html
button. Moral of story: the error message may be accurate but difficult to
decipher--
smHaig
"smHaig" wrote:
I have used your suggestion which seems clearly the right way, but I have
this error:
handles clause requires withevents qualifier.

where would this go? on the function heading. Or is there a withevents
needed and where would that go?
--
smHaig
"smHaig" wrote:
Not being an web programmer I am unable to figure out how to put the
hyperlink mailto:emailaddress in a button click event. I do not want a
hyperlink on the form. I have found nothing to address this. using
response.redirect is not the answer because you do not return to the page
with the button on it.
Also, is it necessary to encode the address and if yes, how to do that, please

Thanks. I am sure this is very simple but I am a windows programmer not used
to links, html, etc.
--
smHaig

Mar 3 '06 #4

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

Similar topics

6
by: Michael Johnson Jr. | last post by:
I am trying to handle a button click event, which updates a web control table with data. The button is dynamically created in the table itself. When I call updateTable() in the Page_Load the new...
4
by: Mark Lingen | last post by:
I've found a problem with postback event handling and webcontrol buttons. Try out the following code in an ASP.Net project and you will see. Create a web project in VB.Net and drop this code...
11
by: Sarah | last post by:
I have code that I want to run so that if the result is true, it changes the current button's ".DialogResult" property to "DialogResult.OK". Problem is, when I run this code on the ".Click" event...
3
by: Robert W. | last post by:
I'm new to ASP.net programming so excuse my ignorance if the following question seems overly simplistic. I've created a simple Login form with 3 primary WebControls: - A TextBox for the Username...
17
by: Eric | last post by:
I'm new to JavaScript and I wrote this code to play with. Oddly, if I enter text in a box and then press the button, I only get the onChange event for the text box and not the button's onclick...
0
by: nraji | last post by:
hi, I have designed a web part using VS 2003 (Web control library template). I need to publish that in share point. Its not like drag and drop the things from toolbar. Every thing I need to do in...
7
by: =?Utf-8?B?bWFydGluMQ==?= | last post by:
Hi, All, I create button in the code ( Dim Button as new Button), not using button web component (means not drap button and drop it ont he webform), after that I try to use button_click event,...
3
by: GauravGupta | last post by:
i want to know that is it posible to call button click event before page load event on post back.... please help me....
4
by: talk2mishal | last post by:
Hi, As i m newbie for the Perl With Html Button. The scenario is like this: I have HTML button in the perl Script. I have to get the Data of Enable checkbox Data using the...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.