protected void exRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
            DataRowView row = (DataRowView)e.Item.DataItem;//当前行的数据 
            DateTime addtime = DateTime.Parse(row["addtime"].ToString());
            TimeSpan ts = DateTime.Now - addtime;
            Label Lclass= (Label)e.Item.FindControl("class");
            if (ts.TotalMinutes < 60)
            {
                Lclass.Text = "xxx";
            }
                 }
    }<ItemTemplate>
<a href="" class="<asp:Label id="class" runat="server" />">xxx</a> //这里的CLASS只能是字符串
</ItemTemplate>也就是说如何只赋值字符串不要其它?

解决方案 »

  1.   

    总技术分:2165
    写出这样的话来啊
    好像不应该吧
    <a href="" class=" <asp:Label id="class" runat="server" />">xxx </a>
    <asp:Label>在HTML下会变成<span>的
    class=“<span>^^^</span>”
    能显示???
    你这技术分在水区混来的吧
      

  2.   

    CSDN真是
    鱼龙混杂
    有几个
    MVP的水平也就一般般
    不过SP1234真是大牛
    却不是MVP
    这论坛办的也是奇怪了
      

  3.   

    你连题目都没看清楚,我的代码是错的不然还发帖干吗
    我就是问使用label会有多余的字符,Literal试了也不行,全局变量也不行