Exemplo n.º 1
0
    protected void BindCommentList()
    {
        CommentManager manager = new CommentManager();
        IList<Comment> comments = manager.GetCommentsByQuestion(this.QuestionID);
        _TotalCount = comments.Count;
        rptCommentList.DataSource = comments;
        rptCommentList.DataBind();

        if (_TotalCount > 0)
            //ltrCommentHeading.Text = "<a href='javascript:void(0);' onclick='ToggleCommentingBox();'>Write your comment here.</a>";
            ltrCommentHeading.Text = "<a href='javascript:void(0);' onclick='ToggleCommentingBox();'>Comment</a>";
        else
        {
            //_CommentListDisplayStyle = "none";
            //ltrCommentHeading.Text = "<a href='javascript:void(0);' onclick='ToggleCommentingBox();'>Be the first to comment on this question.</a>";
            ltrCommentHeading.Text = "<a href='javascript:void(0);' onclick='ToggleCommentingBox();'>Comment</a>";
        }
        if (_LoggedInUser.Author_ID == 0)//Anonymous User
        {
            if (_TotalCount > 0)
                ltrCommentHeading.Text = "Comments";
            else
                ltrCommentHeading.Text = "Sorry! No comment is availabe for this question.";
        }
    }