/// <summary>
    /// Reloads the board messages related to the currently processed message board.
    /// </summary>
    private void ReloadBoardMessages()
    {
        SetContext();

        // If user isn't allowed to read comments
        if (!AuthenticationHelper.IsAuthenticated() && !BoardProperties.BoardEnableAnonymousRead)
        {
            // Do not display existing messages to anonymous user, but inform on situation
            lblNoMessages.Visible = true;
            lblNoMessages.Text    = GetString("board.messagelist.anonymousreadnotallowed");
        }
        else
        {
            // If the message board ID was specified
            if (MessageBoardID > 0)
            {
                string where = "(MessageBoardID = " + MessageBoardID.ToString() + ")";

                // If the user should be displayed with all messages not just approved ones
                if (!BoardInfoProvider.IsUserAuthorizedToManageMessages(bi))
                {
                    where += " AND (MessageApproved = 1) AND ((MessageIsSpam IS NULL) OR (MessageIsSpam = 0))";
                }

                // Get board messages
                zeroRowsText.Visible            = false;
                rptBoardMessages.Visible        = true;
                rptBoardMessages.WhereCondition = where;
                rptBoardMessages.ReloadData(true);
            }
        }

        ReleaseContext();
    }
 /// <summary>
 /// Generate a client JavaScript for displaying modal window for message editing.
 /// </summary>
 private void ProcessData()
 {
     lnkEdit.OnClientClick = "EditBoardMessage('" + ResolveUrl("~/CMSModules/MessageBoards/CMSPages/Message_Edit.aspx") + "?messageid=" + MessageID.ToString() + "&messageboardid=" + MessageBoardID.ToString() + "');return false;";
 }