I have an MVC3 app that uses a Telerik grid. I have a variable with html in it i want to display raw:
o.RawHtml = "This is a <br/> Test";
@(Html.Telerik().Grid(Model)
.Columns(columns =>
{
columns.Bound(o => o.RawHtml).ClientTemplate("<#= RawHtml #>").Title("Raw");
})
According to Telerik samples, this should work, but it doesnt. The output in a browser shows
"This is a < br/> Test"
and not the desired:
This is a
Test
Any ideas? Thanks
Have you tried setting the Encoded
property of the column to false
? This page gives some information.
<%= Html.Telerik().Grid(Model)
.Name("Orders")
.Columns(columns =>
{
columns.Bound(o => o.OrderID).Encoded(false);
})
%>
By default, columns are html encoded.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With