Tag云图
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate> <a href=#><span style="font-size: <%# getFontSize(Eval("CountValue"),10,48) %>px"><%# Eval("TagName") %></span></a> </ItemTemplate>
</asp:Repeater> 
 
<ItemTemplate> <a href=#><span style="font-size: <%# getFontSize(Eval("CountValue"),10,48) %>px"><%# Eval("TagName") %></span></a> </ItemTemplate>
</asp:Repeater>
 public int Max = 0;
    
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DataSet ds = TagDBAdapter.GetMyTagList(UserID);
DataTable dt = ds.Tables[0];
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DataSet ds = TagDBAdapter.GetMyTagList(UserID);
DataTable dt = ds.Tables[0];
            int.TryParse(dt.Compute("Max(CountValue)", "").ToString(),out Max );
            Repeater1.DataSource = dt;
Repeater1.DataBind();
}
Repeater1.DataBind();
}
    }
    public int getFontSize(object o, int MinFontSize, int MaxFontSize)
{
if (o != null && Max!=0)
{
int i = 0;
int.TryParse(o.ToString(),out i);
{
if (o != null && Max!=0)
{
int i = 0;
int.TryParse(o.ToString(),out i);
            return ((MaxFontSize - MinFontSize) / Max * i + MinFontSize);
}
return MinFontSize;
}
}
return MinFontSize;
}
 
                    
                     
                    
                 
                    
                

 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号