-2

Following is the code for insert into database. Using ckeditor, can any changes be done in web.config to insert data ?

  [HttpPost]
    [ValidateInput(false)]
    public ActionResult Create(Content cnt)
    {
        var dbContext = new MyDbDataContext();
        Table4 tb = new Table4();
        tb.Id = cnt.id;
        tb.Title = cnt.title;
        tb.Ptitle = cnt.page_title;
        tb.Url = cnt.url;
        tb.Description = cnt.description;
        dbContext.Table4s.InsertOnSubmit(tb);
        dbContext.SubmitChanges();
        return View();
    }
Kinjal
  • 7
  • 1
  • 7
    I have no idea what your asking. – Liam Jun 05 '14 at 09:46
  • Are you asking whether you need to modify your web.config to be able to use the ckeditor? No, you don't. CKEditor simply works with textbox contents it has no knowledge of your classes. http://stackoverflow.com/a/1876521/2186023 – DrCopyPaste Jun 05 '14 at 09:47
  • I am trying to insert my content page using ckeditor. this code is successfully insert data in database. but at run time it shows tags like


    and all that on browser.

    – Kinjal Jun 05 '14 at 09:50

1 Answers1

0

You should use @Html.Raw(YourItem) so your html tags will render as html Like this

@Html.Raw(item.Story)

Danny
  • 301
  • 1
  • 4
  • 21