Reputation:
I am using KendoUI-Editor
for one of my blogs.
Everything is fine as far writing and formatting for the first time is concerned, on server side i ready the markup generated by the ditor and save it in a text file.
But my blog also has an edit option so when i goto an edit option reads the markup created by editor again to show so that it can be edited in this way:
<textarea name="editor" id="editor" rows="10" cols="30" style="height: 500px; width: 972px;"><a>Hello markup here</a></textarea>
Here inside the editor windows instead of show formatted HTML it shows mark up as it is with tags and everything.
How can i make the editor show formatted HTML instead of just plain mark-up so i can edit it?
Upvotes: 3
Views: 4315
Reputation: 3131
I faced the same issue today. The following got mine to work:
Encode(false)
for the Editor.[AllowHtml]
attribute to the model property, so that the Editor's value is submitted non-encoded and you don't have to decode server-side.Pretty sure this is too late to help you but an answer to your question would have been really nice for me, so hopefully this will benefit the community going forward.
P.S., I'm using the 2013 (.3.1316) Kendo Editor in an MVC4 project. Also, I went back into the code later today and removed the [AllowHtml]
attribute from the model properties that are using the editor and the editor continues to function properly (no longer rendering the markup instead of the formatted code).
Upvotes: 4