📄 edithtml.ascx.cs
字号:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using DNNLite.DesktopModules.HTML;
using NHibernate.Expression;
public partial class DesktopModules_HTML_edithtml : DNNLite.Entites.Modules.PortalModuleBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
HTML h = HTML.FindFirst(new EqExpression("TabModuleId", TabModuleInfo.TabModuleId));
if (h != null)
{
editorl1.HtmlText = Server.HtmlDecode(h.Content);
}
}
}
protected void btnSave_Click(object sender, EventArgs e)
{
try
{
HTML h = HTML.FindFirst(new EqExpression("TabModuleId", TabModuleInfo.TabModuleId));
if (h == null)
{
h = new HTML();
h.keyId = Guid.NewGuid();
h.TabModuleId = TabModuleInfo.TabModuleId;
}
if (chkSaveLocal.Checked)
{
string cnt = editorl1.SaveImgToLocal(editorl1.HtmlText);
editorl1.HtmlText = cnt;
h.Content = Server.HtmlEncode(cnt);
}
else
{
h.Content = Server.HtmlEncode(editorl1.HtmlText);
}
h.SaveAndFlush();
DataCache.Refresh();
lblmsg.Text = "保存成功";
}
catch (Exception ex)
{
ProcessModuleLoadException(ex);
}
}
protected void btnBack_Click(object sender, EventArgs e)
{
Response.Redirect(EditUrl());
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -