Add function to a Button event in asp.net -- Environment is Visual Studio 2012 asp.net/Visual Basic

I need a button called email to take the user to their email program and fill in my email address jmtillery@jandmmfg.com and subject=Question/Comment. This currently works on my website www.jandmmfg.com, but I am changing some things such as putting buttons where there is just text links. Other buttons will just move the user to different pages. I am not sure how to combine the button code with the Mailto or the simple link code. I need to know the syntax of adding function to button code. See below samples.    

<input id="Button1" type="button" value="email"/>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<a href="mailto:jmtillery@jandmmfg.com?subject=Question/Comment"title="jmtillery@jandmmfg.com"><b>email</b></a>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<a href="Equipment.aspx"><b>Equipment</b></a>

Thank you for any help.  --  Joe
jampostGeneral MaanagerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Shalu MCommented:
You could either use javascript or server side code to accomplish this -

In Javascript -

<input id="Button1" type="button" value="email" onclick="email();return false;"/>
<script>
    function email() {
        document.location.href = "mailto:jmtillery@jandmmfg.com?subject=Question/Comment"title="jmtillery@jandmmfg.com;
    }
</script>

Open in new window


Or you could use server side code -

<asp:Button ID="btnEmail" Text=" Email" runat="server"  OnClick="btnEmail_Click" /> 

using System.Diagnostics;
 protected void btnEmail_Click(object sender, EventArgs e)
        {

            var myUrl = "mailto:jmtillery@jandmmfg.com?subject=Question/Comment"title="jmtillery@jandmmfg.com";
            Process.Start(myUrl);


        }

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jampostGeneral MaanagerAuthor Commented:
Thank you for your help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.