Пример #1
0
        /// <summary>
        /// 根据标题查询
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Query_Click(object sender, EventArgs e)
        {
            this.AllMessage.Visible = true;
            string msgName = this.txtMessageTitle.Value.Trim();

            if (msgName == "")
            {
                this.hint.InnerHtml     = "请输入标题";
                this.AllMessage.Visible = false;
                this.showPager.Visible  = true;
            }
            else
            {
                MessageMgr     mgr     = new MessageMgr();
                List <Message> message = mgr.LookSingleMessage(msgName);
                if (message != null)
                {
                    this.MsgRepeater.DataSource = message;
                    this.MsgRepeater.DataBind();
                    this.showPager.Visible = false;
                    this.hint.InnerHtml    = "";
                }
                else
                {
                    this.hint.InnerHtml     = "标题输入错误或者不存在";
                    this.AllMessage.Visible = false;
                    this.showPager.Visible  = true;
                }
            }
        }