⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 postedit.cs

📁 这是一个简单的论坛程序源码
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using NetFocus.Web.Core;

namespace NetFocus.Web.Applications.Forum
{
    public class PostEdit : UserControl
    {
        protected ValuedEditor bodyEditor;
        protected ResourceButton saveButton;

        protected override void OnLoad(EventArgs e)
        {
            if (!Page.IsPostBack && !AjaxManager.IsCallBack)
            {
                BindData();
            }
            saveButton.Click += new EventHandler(SaveArticleComment);
        }

        private void BindData()
        {
            Post post = BusinessManager.GetPost(RequestBuilder.BuildPostRequest(WebContext.Current.EntityId));
            bodyEditor.Value = post.Body;
        }
        private void SaveArticleComment(object sender, EventArgs e)
        {
            Post post = BusinessManager.GetPost(RequestBuilder.BuildPostRequest(WebContext.Current.EntityId));

            post.Body = bodyEditor.Value;

            BusinessManager.UpdatePost(post);

            Page.Response.Redirect(SiteUrls.Instance().GetPostListUrl(post.ParentId));

        }

    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -