# TemplateBuilder

## Properties

### WriteAction - Func

## Methods

### AddHtml(System.String)

Allows setting conventional HTML elements.

#### Parameters

##### html - `System.String`

The value that configures the HTML content.

#### RETURNS

Returns the current [TemplateBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/templatebuilder) instance.

#### Example

```
 
            @(Html.Kendo().Template()
                   .AddHtml("<p>HTML content</p>")
             )
             
```

### AddHtml(System.Func)

Allows setting combining conventional HTML elements with HtmlHelpers coming from the web framework.

#### Parameters

##### html - `System.Func<Object,Object>`

The value that configures the HTML content.

#### RETURNS

Returns the current [TemplateBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/templatebuilder) instance.

#### Example

```
 
            @(Html.Kendo().Template()
                   .AddHtml(@<text><p>HTML content</p></text>)
             )
             
```

### AddComponent(System.Action)

Defines a Telerik UI component into the template.

#### Parameters

##### widgetBuilder - System.Action<[WidgetFactory](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/widgetfactory)>

The action that defines the Telerik UI component.

#### RETURNS

Returns the current [TemplateBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/templatebuilder) instance.

#### Example

```
 
            @(Html.Kendo().Template()
                   .AddComponent(c => c.Button().Name("testBtn").Content("Settings"))
             )
             
```

### WriteTo(System.IO.TextWriter,System.Text.Encodings.Web.HtmlEncoder)

#### Parameters

##### writer - `System.IO.TextWriter`

##### encoder - `System.Text.Encodings.Web.HtmlEncoder`

### ToFormEditor()

Serializes the template to a string that can be used in a form editor.

#### RETURNS

A string representing the template serialized for form editing.
