是否有可能从数据库数据获取mailto地址 [英] is this possible to get mailto address from database data
本文介绍了是否有可能从数据库数据获取mailto地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好朋友,我在表格中有邮件地址,例如abc@abc.com
内部中继器,我编码为
hello friends i m having mailaddress in table like abc@abc.com
inside repeater i coded as
<asp:HyperLink ID="Hp1" NavigateUrl=''mailto:<%#Eval("mail") %>'' runat="server"><%#Eval("mail") %></asp:HyperLink>
但这不起作用.
请给我解决方案
but this is not working.
please give me the solution
推荐答案
使用以下代码.
use the following code.
<asp:HyperLink ID="Hp1" runat="server" NavigateUrl=''<%# string.Concat("mailto:",Eval("Email")) %>'' Text=''<%#Eval("Email") %>''></asp:HyperLink>
只是一个想法.您如何更改SQL以所需的格式获取此电子邮件地址呢?然后您可以像这样创建
Just a thought. What about you changing the SQL to get this email address in the format you want? Then you can create this like,
<asp:HyperLink ID="Hp1" NavigateUrl=''mailto:<%#Eval("mailto") %>'' runat="server"><%#Eval("mail") %>
SELECT email as 'mail, 'mailto:' + email as 'mailto' from MyTable
希望这会有所帮助:)
Hope this helps :)
这篇关于是否有可能从数据库数据获取mailto地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文