コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            facade = new BusinessLogic.BusinessFacade(conn);
            if (Request.Params["id"] != null)
            {
                id = Convert.ToInt16(Request.Params["id"]);
                BusinessLogic.Article.HiringAdvice ha = facade.GetHiringAdviceById(id);
                Guid guid = new Guid(ha.Writer);
                MembershipUser mu = Membership.GetUser(guid);
                lbl_ArticleTitle.Text = ha.Title;

                logo.ImageUrl = Utils.validateImage(General.EMP_HIRING_ADVICE + ha.Writer , ha.Logo);

                lbl_Name.Text = ha.FullName;
                lbl_UploadDate.Text = ha.UploadedDate.ToShortDateString();
                literal_detail.Text = ha.Detail.ToString().Replace(Environment.NewLine, "<br />");
            }
            else
            {
                Response.Redirect("~/publicarea/errorpages/error404.aspx");
            }

            List<Comment> cList = facade.ViewCommentHiringById(id);
            if (cList.Count != 0)
            {
                CollectionPager1.MaxPages = 10000;
                CollectionPager1.PageSize = 10;
                CollectionPager1.DataSource = cList;
                CollectionPager1.BindToControl = repeater_showComment;
                repeater_showComment.DataSource = CollectionPager1.DataSourcePaged;
                repeater_showComment.DataBind();
            }
            else
            {
                repeater_showComment.Visible = false;
            }

            //Limit input characters
            txt_Content.Attributes.Add("onkeydown", "textCounter(this,'" + Label1.ClientID + "', 5000)");
            txt_Content.Attributes.Add("onkeyup", "textCounter(this,'" + Label1.ClientID + "', 5000)");
            txt_Content.Attributes.Add("onmousedown", "textCounter(this,'" + Label1.ClientID + "', 5000)");
            txt_Content.Attributes.Add("onmouseup", "textCounter(this,'" + Label1.ClientID + "', 5000)");
            txt_Content.Attributes.Add("onblur", "textCounter(this,'" + Label1.ClientID + "', 5000)");
        }