Extracting the first tag names from each post

Topics: ASP.NET 2.0
Feb 5, 2009 at 12:28 AM
If i call the TagLinks("") it returns all of the tags with links.

Is there an easy way of just extracting the text of the first tag with no link for each post?

Feb 5, 2009 at 12:39 AM
You want just the text for only the first tag (not the other tags)?  This would give you that ...

<%= Post.Tags.Count > 0 ? Post.Tags[0] : string.Empty %>

If you want just the text for all the tags,

<%= string.Join(", ", Post.Tags.ToArray()) %>
Feb 5, 2009 at 12:46 AM
That's awesome, Thanks a lot.

Just going to use the first tag to grab an image related to a post, so i don't have to upload one manually every time.