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>";
                                }
                            }
                        }
                    }
                }
            }

  • 相关阅读:
    VMware Workstations Pro15.1.0并解锁Unlock3.0.2 安装黑苹果
    正则表达式对字符串匹配
    Linq操作
    C#模糊查询绑定datagridview
    wpf的datepicker处理
    动态调用webservice,不需要添加Web References
    C#调用sap接口及返回数据到sap
    C#中文件管理的运用(Twelfth Day)
    C#中继承,集合(Eleventh day)
    C#中字符串的处理,对象的引用及继承(Tenth day)
  • 原文地址:https://www.cnblogs.com/xiaobaigang/p/824040.html
Copyright © 2011-2022 走看看