Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                return;
            }
            HttpCookie u_cookie = Request.Cookies["LoginOk"];
            HttpCookie r_cookie = Request.Cookies["RolesId"];

            if ((Session["LoginOk"] == null || Session["RolesId"] == null) && (u_cookie == null || r_cookie == null))
            {
                Response.Write("<script>alert('账号信息过期,请重新登入');location.href='../Login.aspx'</script>");
            }
            else
            {
                //我们需要在这个地方进行查询(按照id查询)
                int id   = Request.Params["action"] == null ? 0 : int.Parse(Request.Params["action"]);
                var data = aboutSvc.GetAboutById(id);

                this.txtId.Text       = id.ToString();
                this.txtTitle.Text    = data.Title;
                this.txtContent.Value = data.Content;

                if (data.Images == "" || data.Images == null)
                {
                    this.imgAbout.Attributes.Add("style", "display:none");
                }
                else
                {
                    this.imgAbout.Attributes.Add("style", "display:inline-block");
                    imgSrc = data.Images;
                }
            }
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                return;
            }

            #region 关于我们的绑定

            var about = aboutSvc.GetAboutById(1);
            about_title   = about.Title;
            about_content = about.Content;

            #endregion
        }