protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int nid = Convert.ToInt32(Request.QueryString["nid"]); NewsPaper paper = NewsPaperService.Get_NewsPaperModel(nid); lblPosition.Text = paper.N_Title; lblPosition.Font.Bold = true; lblPosition.ForeColor = Color.Red; CLinkButtonColor(btnPage1); NewsImg.ImageUrl = "../newspaper/" + paper.N_AImg; ViewState["paper"] = paper; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { CommonFunction.isLoginCheck(); ViewState["strAction"] = Request.QueryString["action"]; ViewState["strAImg"] = ""; ViewState["strAImgView"] = ""; ViewState["strBImg"] = ""; ViewState["strBImgView"] = ""; ViewState["strCImg"] = ""; ViewState["strCImgView"] = ""; ViewState["strDImg"] = ""; ViewState["strDImgView"] = ""; if (Request.QueryString["nid"] != null) { int nid = Convert.ToInt32(Request.QueryString["nid"]); ViewState["nid"] = nid; NewsPaper paper = NewsPaperService.Get_NewsPaperModel(nid); txtTitle.Text = paper.N_Title; txtTime.Text = Convert.ToDateTime(paper.N_Time).ToShortDateString(); ImgA.ImageUrl = "../newspaper/" + paper.N_AImgView; ImgB.ImageUrl = "../newspaper/" + paper.N_BImgView; ImgC.ImageUrl = "../newspaper/" + paper.N_CImgView; ImgD.ImageUrl = "../newspaper/" + paper.N_DImgView; ViewState["strAImg"] = paper.N_AImg; ViewState["strAImgView"] = paper.N_AImgView; ViewState["strBImg"] = paper.N_BImg; ViewState["strBImgView"] = paper.N_BImgView; ViewState["strCImg"] = paper.N_CImg; ViewState["strCImgView"] = paper.N_CImgView; ViewState["strDImg"] = paper.N_DImg; ViewState["strDImgView"] = paper.N_DImgView; } else { txtTime.Text = DateTime.Now.ToShortDateString(); } } }