Reputation: 1773
How would I link a label or do I have to use something different then a label. Such a simple task but im new to Csharp.
Dafault.aspx page
Myspace Link:
<a href="<asp:MyspaceLink</asp>">
<asp:Label ID="MyspaceLink" runat="server" Text="Label"></asp:Label></a> </p>
<p>
FaceBook Link:
<a href="<asp:FacebookLink</asp>">
<asp:Label ID="FacebookLink" runat="server" Text="Label" ></asp:Label></a> </p>
Dafault.aspx.cs
foreach (DataRow row in DAMemberInfo.Rows)
{
MyspaceLink.Text = row["MemberMyspace"].ToString();
FacebookLink.Text = row["MemberFacebook"].ToString();
}
Upvotes: 0
Views: 215
Reputation: 30006
You should use a Hyperlink control, not a label like this:
<asp:HyperLink id="hyperlinkFacebook"
NavigateUrl="http://www.facebook.com"
Text="Facebook"
Target="_new"
runat="server"/>
Upvotes: 2
Reputation: 2661
Use a Hyperlink control
http://www.w3schools.com/aspnet/control_hyperlink.asp
Upvotes: 0