Hello,
I tried the RichTextEditor control these days,
Now I have an important issue needs to be solved.
The View page code is:
//=======================================================
@Html.EJ().RTE("rteSample").ContentTemplate(@<div id="textcontent1">
<p><b>Description:</b></p><p></p><ul style='list-style-type: square;'><li>The Rich Text Editor (RTE) control is an easy to render in client side.&nbsp;<br></li><li>Customer easy to edit the contents and get the HTML content for the displayed content.<br></li><li>&nbsp;A rich text editor control provides users with a toolbar that helps them to apply rich text formats to the text entered in the text area.<br></li></ul><p></p>
</div>).Width("820px").ToolsList(toolsList).Tools(tool => tool.Styles(style).Lists(lists).DoAction(doAction).Links(links).Images(images))
//=======================================================
It will worked well, please refer to the 001.png.
But when I used @Viewbag.content and send data, it is defined as string.
Will not compiled as HTML,please refer to the 002.png.
The Demo code is:
//=======================================================
//Controller
public ActionResult Demo()
{
Viewbag.content="<p><b>Description:</b></p><p></p><ul style='list-style-type: square;'><li>The Rich Text Editor (RTE) control is an easy to render in client side.&nbsp;<br></li><li>Customer easy to edit the contents and get the HTML content for the displayed content.<br></li><li>&nbsp;A rich text editor control provides users with a toolbar that helps them to apply rich text formats to the text entered in the text area.<br></li></ul><p></p>";
return View();
}
//View
@Html.EJ().RTE("rteSample").ContentTemplate(@<div id="textcontent1">
@Viewbag.content
</div>).Width("820px").ToolsList(toolsList).Tools(tool => tool.Styles(style).Lists(lists).DoAction(doAction).Links(links).Images(images))
//=======================================================
How did you do to send an HTML format from Controller to View?
Looking forward to your response.
Thanks a lot.
Best regards.
Attachment:
pics_17ea2103.zip