protected void repeaterAll_ItemDataBound(object sender, RepeaterItemEventArgs e) { PostCard pc = e.Item.FindControl("postCard") as PostCard; Post post = e.Item.DataItem as Post; if (post.PostPhoto.Equals("fake.png")) { pc.PostImage = post.PostPhoto; pc.ChangeImageVisibility(); //True by default, change to false } else { pc.PostImage = post.PostPhoto; } pc.PostText = post.PostText; pc.PostUsername = post.Username; pc.Likes = post.Likes.ToString(); pc.PostId = post.Id; pc.PostDate = post.PostDate; pc.PostTagList = new List <string>(); pc.TagSearch += new EventHandler(TagSearchEvent); if (Session["Username"] != null) { pc.DisableFollowButton(Session["Username"].ToString()); } if (Session["Guest"] != null) { pc.EnableGuestRestrictions(); } }
protected void repeaterComments_ItemDataBound(object sender, RepeaterItemEventArgs e) { PostCard pc = e.Item.FindControl("postCard") as PostCard; Comment comment = e.Item.DataItem as Comment; pc.PostText = comment.CommentText; pc.PostUsername = comment.CommentUsername; pc.EnableCommentRestrictions(); pc.PostId = comment.Id; if (Session["Username"] != null) { pc.DisableFollowButton(Session["Username"].ToString()); } if (Session["Guest"] != null) { pc.EnableGuestRestrictions(); } }