private void userReactToPost(Button i_RelevantButton, bool i_Like) { int serialNumOfPost = i_Like ? int.Parse(i_RelevantButton.Name.Substring(4, 1)) : int.Parse(i_RelevantButton.Name.Substring(7, 1)); if (i_Like) { Server.ActOnLike((i_RelevantButton.Parent.Tag as Post)); } else { if (enableCommentOnPost()) { Server.NotifyAboutComment(i_RelevantButton.Parent.Tag as Post); } } outerPanel.Controls.Remove(outerPanel.Controls.Find("postPanel" + serialNumOfPost, false).First()); buildPostCard(Server.GetPost((i_RelevantButton.Parent.Tag as Post).PostId), serialNumOfPost); }