Sent you a PM where you can test. If you compare the html of the two pages you'll see that they are identical. Latest RTE is used, downloaded it yesterday.
The code behind looks like this:
- [Authorize(Roles = "Administratör,Redaktör,Resultat redaktör")]
- public ActionResult NewsAdd()
- {
- Editor Editor1 = new Editor(System.Web.HttpContext.Current, "Editor1");
- Editor1.LoadFormData("Skriv här...");
- Editor1.MvcInit();
- ViewBag.Editor = Editor1.MvcGetString();
- return View();
- }
-
- [Authorize(Roles = "Administratör,Redaktör,Resultat redaktör")]
- public ActionResult TestAdd()
- {
- Editor Editor1 = new Editor(System.Web.HttpContext.Current, "Editor1");
- Editor1.LoadFormData("Skriv här...");
- Editor1.MvcInit();
- ViewBag.Editor = Editor1.MvcGetString();
-
- return View();
- }
Other issues:
1. The design, this is a problem in Cute Editor for ASP.NET as well. It's sensitive to other CSS in the page. I use Zurb Foundation and if I add the editor to page containing that framework all icons get messed up:
2. TinyMCE does a great job integrating with MVC (in all other ways it sucks :)
You just add this: [UIHint("tinymce_jquery_full"), System.Web.Mvc.AllowHtml] to the "variable" in your class, like this:
- [Required]
- Display(Name = "Message")]
- [UIHint("tinymce_jquery_full"), System.Web.Mvc.AllowHtml]
- public string Message { get; set; }
and in your view:
- @Html.EditorFor(m => m.Message)
and there you have a wysiwyg editor that works like any textfield, you don't have to do anything additional in the code behind to manage the result:
- [HttpPost]
- public ActionResult Edit(News news)
- {
- if (ModelState.IsValid)
- {
- db.Entry(news).State = EntityState.Modified;
- db.SaveChanges();
- return RedirectToAction("Index");
- }
- return View(news);
- }
This is something that I would like to see for Rich Text Editor.