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

  • 相关阅读:
    My97DatePicker控件显示时分秒
    【servlet学习1】使用eclipse+tomcat开发servlet示例
    JNI之JAVA调用C++接口
    关闭页面,window.onunload事件未执行的原因
    java finally块执行时机分析
    c# IL 指令集
    java 字节码指令集
    Linux可插拔认证模块(PAM)的配置文件、工作原理与流程
    常用的Linux可插拔认证模块(PAM)应用举例(一)
    开始我的博客旅途
  • 原文地址:https://www.cnblogs.com/xiaobaigang/p/824040.html
Copyright © 2020-2023  润新知