Solved

ASP.net VB.net open email system

Posted on 2013-10-29
2
377 Views
Last Modified: 2013-10-31
Hi

I have a button on my ASP.net web page. When a user clicks o it
I want it to open the users email  in a new email  with
a certain email address as would
happen when you click on an email address in e.g. Word
How would I achieve this?
0
Comment
Question by:murbro
2 Comments
 
LVL 33

Accepted Solution

by:
Big Monty earned 500 total points
ID: 39609125
you should be able to do something like:

<INPUT TYPE="button" VALUE="Email" onClick="location.href='mailto:someAddress@email.com" />

if you're looking to do it through the OnClick event, you'll need to use some JS:

<form id="Form1" method="post" runat="server">
<P>Type 5 in the box and click the button</P>
<P>
<asp:TextBox id="TextBox1" runat="server"></asp:TextBox></P>
<P>
<asp:Button id="Button1" runat="server" Text="Button"></asp:Button></P>
<P>
<asp:HyperLink id="HyperLink1" runat="server" Visible="False"
NavigateUrl="mailto:me@myplace.com">Comment</asp:HyperLink></P>
</form>
Private Sub Button1_Click _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles Button1.Click
If TextBox1.Text = "5" Then
Dim sb As New System.Text.StringBuilder
sb.Append("<script TYPE='text/javascript'>")
sb.Append("window.location='mailto:me@myplace.com' ;")
sb.Append("</script>")
Response.Write(sb.ToString)
End If
End Sub

Open in new window

0
 

Author Closing Comment

by:murbro
ID: 39614135
Thanks very much
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Output Caching in IIS 2 28
ASP.NET gridview select textbox on focus 2 33
tutorial for ebay api 3 32
Sql server insert 13 26
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now