Example #1
0
        /// <summary>
        /// 获取数据并展示
        /// </summary>
        /// <param name="id"></param>
        public void GetData(int id)
        {
            DALnew    dal  = new DALnew();
            newEntity news = dal.Getnews(id);

            ViewState["news"]   = news;//在当前页缓存数据。
            txtTitle.Text       = news.Title;
            txtReleaseTime.Text = news.ReleaseTime.ToString();
            content.Value       = news.Content;
        }
Example #2
0
        public void GetData(int id)
        {
            //将取回的数据在页面进行展示,可以修改的数据使用TextBox来展示,并提供修改。
            //通过按钮触发,实现将数据编辑保存的功能

            DALnew    dal  = new DALnew();
            newEntity news = dal.Getnews(id);

            ViewState["news"] = news;
            desc.Value        = news.Content;
        }
Example #3
0
        public void Bind(int id)
        {
            DALnew    dal  = new DALnew();
            newEntity news = dal.Getnews(id);

            lt1.Text = news.Title;
            lb1.Text = news.ReleaseTime.ToString();
            lt2.Text = news.Content;
            if (!string.IsNullOrEmpty(news.RelateFile))
            {
                lt3.Text = "附件:<a href='" + news.RelateFile + "'>单击下载附件</a>";
            }
        }