2024年4月20日 星期六

[研究]ASP.NET,WebForm,試用Quill 2.0.0 WYSIWYG HTML editor 套件 (BSD)

[研究]ASP.NET,WebForm,試用Quill 2.0.0 WYSIWYG HTML editor 套件 (BSD)

2024-04-20

環境:Visual Studio 2022 + ASP.NET + WebForm + Web Application + C# + SQL Server 2019 + SQL Server Management Studio (SSMS) 19

官方網站:https://quilljs.com/

https://github.com/quilljs/quill/releases

目前最新2.0.0,2024-04-17釋出。

2024-11-01補,NuGet 沒看到 Quill 2.0.0。

********************************************************************************

BSD 授權 License
https://quilljs.com/docs/modules/clipboard#matchers
Quill is developed and maintained by Slab. It is permissively licensed under BSD. Use it freely in personal or commercial projects!

********************************************************************************

Default.aspx

<%@ Page Language="C#" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="WebApplication1.Default" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
<%--    <link href="https://cdn.quilljs.com/1.3.7/quill.snow.css" rel="stylesheet" />
    <script src="https://cdn.quilljs.com/1.3.7/quill.js"></script>--%>
    <link href="https://cdn.jsdelivr.net/npm/quill@2.0.0/dist/quill.snow.css" rel="stylesheet" />
    <script src="https://cdn.jsdelivr.net/npm/quill@2.0.0/dist/quill.js"></script>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <div id="editor"></div>
            <asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click" />
        </div>
    </form>

    <script>
        var quill = new Quill('#editor', {
            theme: 'snow'
        });
    </script>
</body>
</html>



Default.aspx.cs

using System;

namespace WebApplication1
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            string quillContent = Request.Form["editor"];
            Response.Write("<script>alert('" + quillContent + "')</script>");
        }
    }
}




(完)

相關

沒有留言:

張貼留言