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

Defines the fluent API for configuring the EditorSerializationSettings settings.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class EditorSerializationSettingsBuilder

Inheritance: objectEditorSerializationSettingsBuilder

Inherited Members object.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

C#
public EditorSerializationSettingsBuilder(EditorSerializationSettings settings)
Parameters:settingsEditorSerializationSettings

Methods

Defines custom serialization for the editable content. The method accepts a single parameter as a string and is expected to return a string.

C#
public EditorSerializationSettingsBuilder Custom(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The value that configures the custom action.

Returns:

EditorSerializationSettingsBuilder

Example:
C#
@( Html.Kendo().Editor()
.Name("Editor")
.Serialization(d =&gt; d.Custom(@&lt;text&gt;
function(html) {
return html.replace(/(#)/, ",");
}
&lt;/text&gt;)
)
)

Defines custom serialization for the editable content. The method accepts a single parameter as a string and is expected to return a string.

C#
public EditorSerializationSettingsBuilder Custom(string handler)
Parameters:handlerstring

The value that configures the custom action.

Returns:

EditorSerializationSettingsBuilder

Example:
C#
@( Html.Kendo().Editor()
.Name("Editor")
.Serialization(d =&gt; d.Custom("htmlSerialization"))
)
&lt;script&gt;
function htmlSerialization(html) {
return html.replace(/(&lt;\/?)b(\s?)/, "$1strong$2");
}
&lt;/script&gt;

Indicates whether the characters outside the ASCII range will be encoded as HTML entities. By default, they are encoded.

C#
public EditorSerializationSettingsBuilder Entities(bool value)
Parameters:valuebool

The value that configures the entities.

Returns:

EditorSerializationSettingsBuilder

Example:
C#
@( Html.Kendo().Editor()
.Name("Editor")
.Serialization(d =&gt; d.Entities(true))
)

Indicates whether optizable tags (e.g. span and font elements with no attributes) should be removed from the DOM.

C#
public EditorSerializationSettingsBuilder OptimizeTags(bool value)
Parameters:valuebool

The value that configures the optimizeTags.

Returns:

EditorSerializationSettingsBuilder

Example:
C#
@( Html.Kendo().Editor()
.Name("Editor")
.Serialization(d =&gt; d.OptimizeTags(true))
)

Indicates whether inline scripts will be serialized and posted to the server.

C#
public EditorSerializationSettingsBuilder Scripts(bool value)
Parameters:valuebool

The value that configures the scripts.

Returns:

EditorSerializationSettingsBuilder

Example:
C#
@( Html.Kendo().Editor()
.Name("Editor")
.Serialization(d =&gt; d.Scripts(true))
)

Indicates whether the font styles will be saved as semantic (strong / em / span) tags, or as presentational (b / i / u / font) tags. Used for outputting content for legacy systems. Default: true.

C#
public EditorSerializationSettingsBuilder Semantic(bool value)
Parameters:valuebool

The value that configures the semantic.

Returns:

EditorSerializationSettingsBuilder

Example:
C#
@( Html.Kendo().Editor()
.Name("Editor")
.Serialization(d =&gt; d.Semantic(false))
)