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; } }
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; } }