Click here to Skip to main content
15,891,513 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
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; }
    }


this is My razor view code:

HTML
@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>


this is my controller:
C#
[HttpPost]
[ValidateInput(false)]
public ActionResult Editor(Content model)
{
    ViewBag.Text = model.Text;
    return View();
}

I get html string in my controller.I want to send this string to view and shown.how I can do it?
thanks.
Posted
Updated 16-Jul-13 11:18am
v2

1 solution

XML
Ok.I find Answer.
I use this and my problem is solved.
<pre lang="HTML">
@Html.Raw(Model.Text)

But I do not delete this question for guys that have such problem.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900