How to implement Tagging in Web 2.0
A tag, according to Wikipedia, is “a (relevant) keyword or term associated with or assigned to a piece of information (e.g. a picture, article, or video clip), thus describing the item and enabling keyword-based classification of information.” Simply tags are like keyword or category labels, and they can help visitors find items which have something in common.
Here is the how you can implement tags using asp.net
You can put the tags on the database for each item. And you can use repeater to dispay the tags.
Most important thing is u need different font size for each tag. You can create a set of 3-4 font size and set them randomly for each item on repeater.
Here is the sample code.
I have used here the object datasoure. You can switch to for your own binding.
<asp:Repeater ID="rptKeywords" runat="server" DataSourceID="odsKeywords">
<ItemTemplate><span style="font-size:<%= GetKeywordSize() %>px;font-weight:<%= GetFontWeight() %>;">
<asp:Label ID="lblKeywords" runat="server" Text='<%# Eval("Keyword") %>'></asp:Label> </span>
</ItemTemplate></asp:Repeater>
<asp:ObjectDataSource ID="odsKeywords" runat="server" SelectMethod="GetKeywords" TypeName="VideoController">
<SelectParameters>
<asp:ControlParameter ControlID="hfVideoId" DefaultValue="0" Name="VideoID" PropertyName="Value" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
'Code behind
Partial Class PageName Inherits Page
Dim obj As New Random()
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Protected Function GetKeywordSize() As Integer
Return obj.Next(12, 18)
End Function
Protected Function GetFontWeight() As Integer
Return obj.Next(100, 1000)
End Function End Class






