Click here to Skip to main content
15,922,533 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I want to assisgn label text to href link.

That means,

label text="sadf@gmail.com".

I want to assigning my label text to href link.

i.e as

href="mailto:label.text".

How can i assign label text to href
Posted

What you probably need to look at and use is the hyperlink[^] control.
 
Share this answer
 
Comments
Wonde Tadesse 5-Dec-11 12:27pm    
5+
What about using jQuery?

JavaScript
<script type="text/javascript">
$(document).ready(function () {
    $('#myAnchorID').attr('href', 'mailto;' + $('#<%=myLabel.ClientID').html());
});
</script>
 
Share this answer
 
v2
Comments
Wonde Tadesse 5-Dec-11 12:27pm    
5+
<asp:HyperLink ID="HyperLink1" runat="server" Font-Size="Small"
Font-Bold="False">
<asp:Label ID="lblemailid" runat="server" Font-Size="Small" ></asp:Label></asp:HyperLink>




HyperLink1.Text = Session["Emaild"].ToString();
HyperLink1.NavigateUrl = "mailto:" + Session["Emaild"].ToString();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900