Beispiel #1
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void Page_Load(object sender, System.EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                _messageText                 = string.Empty;
                _messageTextHTML             = string.Empty;
                tbxMessage.Text              = _originalMessageText;
                lblForumName.Text            = _forumName;
                lblThreadSubject.Text        = HttpUtility.HtmlEncode(_threadSubject);
                lblTextType.Text             = _messageType;
                btnPost.Text                 = _buttonText;
                rfvMessage.Enabled           = !_allowEmptyMessage;
                chkAddAttachment.Visible     = _showAddAttachment;
                chkSubscribeToThread.Visible = (_showSubscribeToThread && CacheManager.GetSystemData().SendReplyNotifications);
                chkSubscribeToThread.Checked = SessionAdapter.GetUserAutoSubscribeToThread();

                if (_isThreadStart)
                {
                    phSubjectRow.Visible      = true;
                    phHeaderNewThread.Visible = true;
                    lblForumDescription.Text  = _forumDescription;
                    phCanBeSticky.Visible     = _canBeSticky;
                    rfvSubject.Enabled        = true;
                    if (!_canBeNormal && _canBeSticky)
                    {
                        // user can't uncheck sticky and has to be checked.
                        chkIsSticky.Checked = true;
                        chkIsSticky.Enabled = false;
                    }
                }
                else
                {
                    phHeaderNormal.Visible = true;
                }
            }
        }