zoukankan      html  css  js  c++  java
  • DataList留言本回复后 Label显示数据

     protected void DataList_ItemDataBound(object sender, DataListItemEventArgs e)
            {
                ListItemType itemType = e.Item.ItemType;

                if (itemType == ListItemType.AlternatingItem || itemType == ListItemType.Item)
                {
                    DataRowView tempRow = (DataRowView)e.Item.DataItem;
                    int pid = Convert.ToInt32(tempRow.Row["id"].ToString());
                    Label lbl = e.Item.FindControl("lblTXT") as Label;
                    if (lbl != null)
                    {
                        lbl.Text = tempRow.Row["Content"].ToString();
                        if (pid > 0)
                        {
                            DataSet ds = NoteBook.GetNoteReply(pid);
                            if (ds.Tables.Count > 0)
                            {
                                foreach (DataRow dr in ds.Tables[0].Rows)
                                {
                                    lbl.Text += "<p class=\"replay\"><span>回复内容:" + dr["Content"].ToString() + "</span><span>姓名:" + dr["Name"].ToString() + "</span><span>时间:" + dr["PubTime"].ToString() + "</span></p>";
                                }
                            }
                        }
                    }
                }
            }

  • 相关阅读:
    CLR
    Cocos2dx 3.12 在AndroidStudio上编译配置
    MFC 调试方法
    列表初始化
    类型转换
    Cocos2d-x 3.4在AndroidStudio上编译配置
    出发 Let's Go
    LumiSoft.Net邮件接收乱码问题解决
    百度地图经纬度转换JS版
    百度经纬度和google经纬度互转
  • 原文地址:https://www.cnblogs.com/xiaobaigang/p/824040.html
Copyright © 2011-2022 走看看