Razor - Render without Render () and without encoding

Can someone explain how the following is achieved. The Telerik Grid component will generate uncoded HTML with the following code:

@(Html.Telerik().Grid(Model)
        .Name("Grid")
        .DataKeys(keys => keys.Add(c => c.ProductID))
        .DataBinding(dataBinding => dataBinding.Server()
            .Select("ColumnSettings", "Grid")
            .Update("ColumnSettings_Save", "Grid")
            .Delete("ColumnSettings_Delete", "Grid"))
        .Columns(columns =>columns.LoadSettings((IEnumerable<GridColumnSettings>)ViewData["Columns"]))
        .Sortable()
)

Presumably this happens because the method call is wrapped in "@ (....)". Whenever I try this with my own components, the result is encoded in Html. I know that I can use Render () to output MvcHtmlString, and then my Html is not encoded, but the Telerik grid seems to achieve this without .Render ().

Can anyone tell me a secret?

+5
source share
1 answer

@() ( - ) .

- MvcHtmlString, Razor.

, Builder, , . Builder IHtmlString, .Sortable() HTML .

+3

All Articles