SiteCore 6.5 - GeneralLink

Posted by Steve Ward on Stack Overflow See other posts from Stack Overflow or by Steve Ward
Published on 2013-11-12T02:46:58Z Indexed on 2013/11/12 3:54 UTC
Read the original article Hit count: 140

Filed under:

Im new to SiteCore.. I have created a Page template and add a field for a URL of type General Link. I have created another field for the text for the link (this is standard practice in this project).

I simply want to display the link in my user control but I just cant get it to work. This should be simple but Im going round in circles

Here's an example of the code I've tried ..

ascx :

ascx.cs:

lnkMain.NavigateUrl = SiteCore.Context.Item.GetGeneralLink("Link1"); lnkMain.Text = item.GetFieldValue("Link1Text");

© Stack Overflow or respective owner

Related posts about sitecore