Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

LinkText to include HTML
Jason
#1 Posted : Tuesday, October 18, 2011 9:51:04 AM(UTC)
Rank: Member
Groups: Registered

Joined: 10/16/2011(UTC)
Posts: 27
Location: Athens, Greece
I need to produce include HTML within the LinkText.

If I do this for example:
@Html.FrontHtml().PageLink(item.LinkText + "<span>read more</span>", item.FullName,null,new {title=item.Title})

the span tag is html escaped.

Is there a way to build the a tag on my own?
Jason
#2 Posted : Thursday, October 20, 2011 11:01:11 AM(UTC)
Rank: Member
Groups: Registered

Joined: 10/16/2011(UTC)
Posts: 27
Location: Athens, Greece
I did it eventually as such:

<li>
<a href="/@item.FriendlyName" title="@item.Title">@item.LinkText<span>@item.HtmlMeta.Description<span></a>
</li>
jifeng
#3 Posted : Friday, October 21, 2011 1:46:42 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,555
Location: Xiamen China
Correct way.
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
cfastner
#4 Posted : Thursday, January 26, 2012 9:51:02 AM(UTC)
Rank: Newbie
Groups: Registered

Joined: 12/7/2011(UTC)
Posts: 9
Hi,

this methode works fine.
But it won't resolve the sitePath settings or any other subpages.

Is there a way to use the PageLink method to wrap existing html with the created link?
Or another method to create a valid link target?

If not, this would be a very helpful feature.

thx
cfastner
jifeng
#5 Posted : Friday, January 27, 2012 10:41:50 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,555
Location: Xiamen China
The correct way is :


<li>
<a href="@Url.FrontUrl().PageUrl(item.FullName)" title="@item.Title">@item.LinkText<span>@item.HtmlMeta.Description<span></a>
</li>
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF 1.9.5.5 | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.520 seconds.