示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int newsid;

            if (!IsPostBack)
            {
                flag = true;
                if (Request.QueryString["newsid"] != null)
                {
                    newsid = Convert.ToInt32(Request.QueryString["newsid"].ToString());
                    SqlDataReader dt = NewsBll.read(newsid);
                    dt.Read();
                    if (dt != null)
                    {
                        txtTitle.Text   = dt[1].ToString().Trim();
                        txtTime.Text    = string.Format("{0:yyyy-MM-dd hh:mm}", dt[2]);
                        txtContent.Text = dt[3].ToString();
                        //txtClass.Text=dt[6].ToString();
                        string img1 = dt[4].ToString().Trim();
                    }
                    BingNC();
                    //显示总共多少评论
                    Label1.Text = News_CommentaryBll.news_allncnum(newsid).ToString();
                }
            }
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int newsid;

            if (!IsPostBack)
            {
                if (Request.QueryString["newsid"] != null)
                {
                    newsid = Convert.ToInt32(Request.QueryString["newsid"].ToString());
                    SqlDataReader dt = NewsBll.read(newsid);
                    dt.Read();
                    if (dt != null)
                    {
                        txtTitle.Text   = dt[1].ToString().Trim();
                        txtTime.Text    = string.Format("{0:yyyy-MM-dd hh:mm}", dt[2]);
                        txtContent.Text = dt[3].ToString();
                        txtImg1.Text    = dt[4].ToString().Trim();

                        txtNum.Text   = dt[5].ToString().Trim();
                        txtClass.Text = dt[6].ToString().Trim();
                    }
                }
            }
        }