A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.telerik.com/aspnet-mvc/html-helpers/editors/editor/serialize below:

ASP.NET MVC Editors Editor Serialization and Deserialization

New to Telerik UI for ASP.NET MVC? Start a free 30-day trial Serialize and Deserialize Content

The Editor component allows you to configure and apply custom definitions for serializing and deserializing its content.

Serializing

The Editor provides the following configuration options:

    @(Html.Kendo().Editor()
        .Name("editor")
        .Serialization(s => s
            .Entities(true)
            .Scripts(true)
            .Semantic(true)
            .Custom("serializeHandler")
        )
    )

    <script>
        function serializeHandler(html) {
            return html.replace(/(<\/?)b(\s?)/, "$1strong$2");
        }
    </script>
Deserializing

Deserialization is the process of parsing the HTML string input from the value() method or from the viewHtml dialog into editable content. The deserialization configuration method allows you to use a custom JavaScript handler, as demonstrated in the following example.

    @(Html.Kendo().Editor()
        .Name("editor")
        .Deserialization(ds => ds
            .Custom("deserializeHandler")
        )
    }

    <script>
        function deserializeHandler(html) {
            return html.replace(/(<\/?)b(\s?)/, "$1strong$2")
        }
    </script>
See Also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4