I’m using editor from Kendo UI, so I have big problem.
I don’t know how display items which are returned by editor.
Editor convert something like:
<img src="someurl" />
to:
lt;p><img src="someurl"/></p>
and I keep converted string in database, and try display it with:
@Html.Raw(item.description)
where description is string returned by kendo.
So I have no idea how display it correctly in my View
Any help would be appreciated.
There is an option of the KendeUI editor called
encodedwhich configures whether the Editor should submit encoded HTML tags or not.The default value for
encodedistrueIf you wan’t to store the unencoded text use this sniplet when creating your editor:
But because you are not sending encoded text to the server the Asp.net request validator kicks in and it will abort your request.
If you are using strongly typed views what you can do is to use the
AllowHtmlAttributeon your model property:View:
Model:
Controller action
You also need to set the following in your web.config or this attribute won’t have effect in .NET 4.0: