📄 postedit.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 + -