Esempio n. 1
0
        protected void RptComments_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            HiddenField UserID    = e.Item.FindControl("UserID") as HiddenField;
            HiddenField PostID    = e.Item.FindControl("PostID") as HiddenField;
            Label       UserName  = e.Item.FindControl("UserName") as Label;
            Label       PostTitle = e.Item.FindControl("PostTitle") as Label;

            if (!string.IsNullOrWhiteSpace(UserID.Value))
            {
                UserName.Text = Users_B.UserByID(UserID.Value).Username;
            }
            if (!string.IsNullOrWhiteSpace(PostID.Value))
            {
                PostTitle.Text = Posts_B.PostByID(PostID.Value).Title;
            }
        }
Esempio n. 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!string.IsNullOrWhiteSpace(Request.QueryString["PostId"]))
     {
         Posts_M Post = Posts_B.PostByID(Request.QueryString["PostId"]);
         Page.Title       = Post.Title;
         lblTitle.Text    = Post.Title;
         PostDesc.Text    = Post.Post;
         PublishTime.Text = Post.PublishTime.ToShortDateString();
         int CategoryId = Post.TaxonomyId;
         CategoryName.Text = Taxonomy_B.getTaxonomyByID(CategoryId.ToString()).TaxonomyName;
     }
     else
     {
         Response.Redirect("Index.aspx");
     }
 }
Esempio n. 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ddlcate.DataSource     = Taxonomy_B.TaxList();
         ddlcate.DataValueField = "TaxonomyId";
         ddlcate.DataTextField  = "TaxonomyName";
         ddlcate.DataBind();
         if (!string.IsNullOrWhiteSpace(Request.QueryString["postId"]))
         {
             Posts_M post = Posts_B.PostByID(Request.QueryString["postId"]);
             txtTitle.Text   = post.Title;
             ddlcate.Text    = post.TaxonomyId.ToString();
             postdesc.Text   = post.Post;
             btnaddpost.Text = "修改";
         }
     }
 }
Esempio n. 4
0
        protected void CommentList_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            HiddenField UserId   = e.Item.FindControl("UserId") as HiddenField;
            Label       userName = e.Item.FindControl("userName") as Label;

            if (!string.IsNullOrWhiteSpace(UserId.Value))
            {
                Users_M user = Users_B.UserByID(UserId.Value);
                userName.Text = user.Username;
            }
            HiddenField PostId    = e.Item.FindControl("PostId") as HiddenField;
            Label       PostTitle = e.Item.FindControl("PostTitle") as Label;

            if (!string.IsNullOrWhiteSpace(PostId.Value))
            {
                Posts_M post = Posts_B.PostByID(PostId.Value);
                PostTitle.Text = post.Title;
            }
        }