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

Defines the fluent interface for configuring the Editor snippets feature.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class EditorSnippetBuilder

Inheritance: objectEditorSnippetBuilder

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

Constructors

C#
public EditorSnippetBuilder(IList<DropDownListItem> items, IVirtualPathProvider provider)
Parameters:itemsIList<DropDownListItem>providerIVirtualPathProvider

Methods

Adds predefined HTML code snippets in the content area.

C#
public EditorSnippetBuilder Add(string title, string snippet)
Parameters:titlestring

The title of the snippet.

snippetstring

The HTML content of the snippet.

Returns:

EditorSnippetBuilder

Example:
C#
@(Html.Kendo().Editor()
.Name("Editor")
.Tools(tools =&gt; tools
.Snippets(snippets =&gt; snippets
.Add("Signature", "&lt;p&gt;Regards,&lt;br /&gt; John Doe,&lt;br &lt;a
href='mailto:john.doe@example.com'&gt;john.doe@example.com&lt;/a&gt;&lt;/p&gt;")
)
)
)

Loads predefined HTML code snippets in the content area from a file.

C#
public EditorSnippetBuilder AddFromFile(string title, string pathToSnippet)
Parameters:titlestring

The title of the snippet.

pathToSnippetstring

The path to the file that contains the snippet.

Returns:

EditorSnippetBuilder

Example:
C#
@(Html.Kendo().Editor()
.Name("Editor")
.Tools(tools =&gt; tools
.Snippets(snippets =&gt; snippets
.AddFromFile("Signature", "~/Content/SignatureSnippet.html")
)
)
)