Hi,
Can you try my code? Does it has the same issue too?
- protected Editor PrepairEditor(Action<Editor> oninit)
- {
- Editor editor = new Editor(System.Web.HttpContext.Current, "editor");
-
- editor.ClientFolder = "/richtexteditor/";
- editor.ContentCss = "/Content/example.css";
-
-
-
- editor.Text = "Type here";
-
- editor.AjaxPostbackUrl = Url.Action("EditorAjaxHandler");
-
- if (oninit != null) oninit(editor);
-
-
- bool isajax = editor.MvcInit();
-
- if (isajax)
- return editor;
-
-
- if (this.Request.HttpMethod == "POST")
- {
- string formdata = this.Request.Form[editor.Name];
- if (formdata != null)
- editor.LoadFormData(formdata);
- }
-
-
- ViewBag.Editor = editor.MvcGetString();
-
- return editor;
- }
-
-
-
- [ValidateInput(false)]
- public ActionResult EditorAjaxHandler()
- {
- PrepairEditor(delegate(Editor editor)
- {
-
- });
- return new EmptyResult();
- }
- [ValidateInput(false)]
- public ActionResult output_xhtml()
- {
- PrepairEditor(delegate(Editor editor)
- {
- editor.LoadHtml("~/example.html");
- });
- return View();
- }
-
- [HttpPost]
- [ValidateInput(false)]
- public ActionResult output_xhtml(string m)
- {
- Editor theeditor = PrepairEditor(delegate(Editor editor)
- {
-
- });
-
- theeditor.SavePDF("~/aaa.pdf");
-
- return View();
- }
View page
- <!DOCTYPE html>
- <html>
- <head>
- <title>RichTextEditor - Output XHTML</title>
- <link rel="stylesheet" href="/Content/example.css" type="text/css" />
- </head>
- <body>
- <script type="text/javascript">
- var editor;
- function RichTextEditor_OnLoad(rteeditor) {
- editor = rteeditor;
- var content = true;
- if (!content) {
- setTimeout(function () {
- editor.SetText("<table cellspacing=\"4\" cellpadding=\"4\" border=\"0\"><tr><td><p><img src=\"http://www.richtexteditor.com/uploads/j0262681.jpg\" alt=\"\" /></p></td> <td> <p>When your algorithmic and programming skills have reached a level which you cannot improve any further, refining your team strategy will give you that extra edge you need to reach the top. We practiced programming contests with different team members and strategies for many years, and saw a lot of other teams do so too.</p></td></tr> <tr> <td> <p> <img src=\"http://www.richtexteditor.com/uploads/PH02366J.jpg\" alt=\"\" /></p></td> <td> <p>From this we developed a theory about how an optimal team should behave during a contest. However, a refined strategy is not a must: The World Champions of 1995, Freiburg University, were a rookie team, and the winners of the 1994 Northwestern European Contest, Warsaw University, met only two weeks before that contest.</p></td></tr></table>");
- }, 1000);
- return;
- }
- }
- </script>
- @using (Html.BeginForm())
- {
- <h1>
- Support output well-formed HTML and XHTML</h1>
- <p>
- This example shows RichTextEditor supports output well-formed XHTML. Your choice
- of XHTML 1.0 or HTML 4.01 output.
- </p>
- <div>
- @Html.Raw(ViewBag.Editor)
- <br />
- <button id="btn_sumbit" type="submit">
- Submit</button>
- </div>
- <br />
- <div>
- <h3>
- Result html:</h3>
- <div>
- @ViewBag._content
- </div>
- </div>
- }
- </body>
- </html>
Regards,
Ken