Hi every body. I create a mvc3 app. I use a ckeditor in my App for save news.I have a Content class for model: <pre lang="c#"> public class Content { [AllowHtml] public string Text { get; set; } }
@model Myapp.Models.Content @{ ViewBag.Title = "Content Entry"; } <html> <head> <title></title> <script src="@Url.Content("~/ckeditor/ckeditor.js")" type="text/javascript"></script> </head> <body> @using (Html.BeginForm("Editor", "Home", FormMethod.Post, new { enctype = "multipart/form-data" })) { @Html.TextAreaFor(model => model.Text, new { @class = "ckeditor", @id = "text-details" }) <p><input type="submit" value="Submit" /></p> } </body></html>
[HttpPost] [ValidateInput(false)] public ActionResult Editor(Content model) { ViewBag.Text = model.Text; return View(); }
Ok.I find Answer. I use this and my problem is solved. <pre lang="HTML"> @Html.Raw(Model.Text)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)