Com.H.Web.UI.WordPasteEditor
1.1.0
See the version list below for details.
dotnet add package Com.H.Web.UI.WordPasteEditor --version 1.1.0
NuGet\Install-Package Com.H.Web.UI.WordPasteEditor -Version 1.1.0
<PackageReference Include="Com.H.Web.UI.WordPasteEditor" Version="1.1.0" />
<PackageVersion Include="Com.H.Web.UI.WordPasteEditor" Version="1.1.0" />
<PackageReference Include="Com.H.Web.UI.WordPasteEditor" />
paket add Com.H.Web.UI.WordPasteEditor --version 1.1.0
#r "nuget: Com.H.Web.UI.WordPasteEditor, 1.1.0"
#:package Com.H.Web.UI.WordPasteEditor@1.1.0
#addin nuget:?package=Com.H.Web.UI.WordPasteEditor&version=1.1.0
#tool nuget:?package=Com.H.Web.UI.WordPasteEditor&version=1.1.0
Com.H.Web.UI.WordPasteEditor
An ASP.NET Web Forms server control that provides a rich-text editor with automatic Microsoft Word paste cleanup.
This control wraps the word-paste-editor client-side library — a zero-dependency JavaScript editor that sanitizes Word HTML while preserving meaningful formatting.
Features
- Word paste cleanup — strips Office markup while keeping tables, colors, fonts, bold/italic, lists, images, and links. Word's automatic numbering (including serial-number columns in tables) is kept as literal numbers.
- Optional formatting toolbar —
Toolbar="true"adds bold, italic, underline, colours, alignment, links, and clear formatting. - Server control — drop-in
<wpe:Editor>tag with ViewState,IPostBackDataHandler, andContentChangedevent. - UpdatePanel compatible — works inside async postback panels.
- Debounced sync — configurable debounce interval (default 300 ms).
- Zero client dependencies — all JS/CSS is embedded in the assembly.
- Read-only mode —
ReadOnly="true"for non-editable rendering.
Quick Start
Register the tag prefix:
<%@ Register TagPrefix="wpe"
Namespace="Com.H.Web.UI.WordPasteEditor"
Assembly="Com.H.Web.UI.WordPasteEditor" %>
Add the editor:
<wpe:Editor ID="MyEditor" runat="server"
Width="100%" Height="300px" Toolbar="true" />
Read/write content in code-behind:
string html = MyEditor.Content;
MyEditor.Content = "<p>Hello, world!</p>";
Properties
| Property | Type | Default | Description |
|---|---|---|---|
Content |
string |
"" |
HTML content of the editor. |
ReadOnly |
bool |
false |
Disables editing when true. |
Toolbar |
bool |
false |
Formatting toolbar above the editor (never when ReadOnly). |
DebounceInterval |
int |
300 |
Debounce interval in milliseconds. |
CssClass |
string |
"wpe-editor" |
CSS class on the editor div. |
Width |
string |
"" |
CSS width (e.g. "100%"). |
Height |
string |
"" |
CSS height (e.g. "300px"). |
Documentation
Full documentation and source code: GitHub
Upstream JS library: word-paste-editor
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net481 is compatible. |
-
.NETFramework 4.8.1
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
1.1.0: Optional formatting toolbar (Toolbar="true"): bold, italic, underline, text and highlight colour, alignment, links, clear formatting. Word auto-numbering now pastes as the literal numbers Word showed, including serial-number columns in tables (these used to paste as bullets). Public EditorClientID property. Fixed: an edit made just before an UpdatePanel async postback could be lost; Chrome added font-family: inherit spans when aligning text. Client library word-paste-editor 1.1.0.