Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get mailto address from a textbox on web page

Status
Not open for further replies.

olivia919

Programmer
May 19, 2005
24
US
I tried
<A href="mailto: '<%#txtRequester.value%>'"> in my html code to open a outlook with the email address in txtRequester.
It opens outlook with empty value. I am not sure what I have done wrong. Anybody can help? Thanks.
 
Rather than write out to a HTML tag, you should use a literal control or a hyperlink. e.g.
Code:
<asp:Literal id="Literal1" runat="server"></asp:Literal>
or
Code:
<asp:HyperLink id="HyperLink1" runat="server">HyperLink</asp:HyperLink>
Then, you can just set them accordingly e.g.
Code:
Literal1.Text = "<a href=""mailto:" & TextBox1.Text & """>Email</a>"
or
Code:
HyperLink1.NavigateUrl = "mailto:" & TextBox1.Text



____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top