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

📄 edithtml.ascx.cs

📁 如果不使用IIS,请先运行 XSP.exe,待提示已侦听 8080端口后
💻 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 + -