Hello guys,
I have a View with a Kendo Editor.
Well, in the controller I have the following:
When I run the project and go to the View, I see in the editor the full text "<a>bbb</a>".
Any work around to solve it?
Regards
I have a View with a Kendo Editor.
@(Html.Kendo().Editor() .Name("editor") .HtmlAttributes(new { style = "width: 740px;height:440px" }) .Value(@<text>@ViewBag.FirstText</text> ))public ActionResult ShowEditor(int id){ ViewBag.FirstText = "<a>bbb</a>"; return View();}When I run the project and go to the View, I see in the editor the full text "<a>bbb</a>".
Any work around to solve it?
Regards
4 Answers, 1 is accepted
0
Accepted
Hi Javier,
Dimo
Telerik
The Editor configuration is incorrect. Please remove @<text> and </text>. They are needed only when supplying HTML markup directly.
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Javier
Top achievements
Rank 1
answered on 28 May 2013, 06:33 PM
Thank you so much Dimo.
0
Tony
Top achievements
Rank 1
answered on 03 Aug 2013, 06:07 AM
I am also having this problem, but mine doesn't have the <text> tags.
My code looks like this:
For the code that loads into the page it looks like this:
This is the html that comes from the KendoUI Editor example.
It outputs the following in the editor box:
When I put content between <text> tags and post back, the content doesn't render properly after the postback, either. It shows the HTML content before but only shows tags after postback.
Any ideas how I can fix this?
My code looks like this:
<ul style="float:left;"> <li> <label for="content" class="required">Content:</label> @(Html.Kendo().Editor() .Name("content") .HtmlAttributes(new { style = "width: 740px;height:289px" }) .Value(ViewBag.Content) ) </li>
</ul>
<ul style="float:left;"> <li><br /> <input type="submit" value="Send" /> </li>
</ul>For the code that loads into the page it looks like this:
public ActionResult Email(){ ViewBag.Content = "<p><img alt=\"Editor for ASP.NET MVC logo\" src=\"http://www.kendoui.com/Image/kendo-logo.png\" style=\"margin-right:auto;margin-left:auto;display:block;\" /></p><p>Kendo UI Editor allows your users to edit HTML in a familiar, user-friendly way.<br />In this version, the Editor provides the core HTML editing engine, which includes basic text formatting, hyperlinks, lists, and image handling. The widget <strong>outputs identical HTML</strong> across all major browsers, follows accessibility standards and provides API for content manipulation. </p><p>Features include:</p><ul><li>Text formatting & alignment</li><li>Bulleted and numbered lists</li><li>Hyperlink and image dialogs</li><li>Cross-browser support</li><li>Identical HTML output across browsers</li><li>Gracefully degrades to a <code>textarea</code> when JavaScript is turned off</li></ul><p>Read <a href=\"http://www.kendoui.com/documentation/introduction.aspx\">more details</a> or send us your <a href=\"http://www.kendoui.com/forums.aspx\">feedback</a>! </p>"; return View();}It outputs the following in the editor box:
<p><img alt="Editor for ASP.NET MVC logo" src="http://www.kendoui.com/Image/kendo-logo.png" style="margin-right:auto;margin-left:auto;display:block;" /></p><p>Kendo UI Editor allows your users to edit HTML in a familiar, user-friendly way.<br />In this version, the Editor provides the core HTML editing engine, which includes basic text formatting, hyperlinks, lists, and image handling. The widget <strong>outputs identical HTML</strong> across all major browsers, follows accessibility standards and provides API for content manipulation. </p><p>Features include:</p><ul><li>Text formatting & alignment</li><li>Bulleted and numbered lists</li><li>Hyperlink and image dialogs</li><li>Cross-browser support</li><li>Identical HTML output across browsers</li><li>Gracefully degrades to a <code>textarea</code> when JavaScript is turned off</li></ul><p>Read <a href="http://www.kendoui.com/documentation/introduction.aspx">more details</a> or send us your <a href="http://www.kendoui.com/forums.aspx">feedback</a>! </p>Any ideas how I can fix this?
0
Hi Tony,
Dimo
Telerik
Please refer to the following forum post for more information.
http://www.kendoui.com/forums/kendo-ui-web/editor/problems-with-editor-showing-html-tags.aspx#JsJ0tK_u7UmCRFMSEY92JA
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
