[RESOLVED]How to Implement a CKeditor in MVC


I am newibe in MVC. I have a visual studio 2012. I want to create an mvc application.In this Application , want to use CkEditor In MVC.I want to enter some text in CK editor textbox and insert this text into a table as html string.Am using Sql server 2008
.Want to insert the data through ADO.net class and not through entiity framework.Pls provide some sample solution




for the ckeditor open up nuget and search for ckeditor.mvc

first of all you have to know examples aren’t just given here it’s a support forum not a school or whatever.

the easiest way for you to get this to work is with a viewmodel 

in this viewmodel you make a property and give it the attribute [allowhtml] you can use attributes on these properties something like:

public class BlogEntry {

    public string BlogText {get;set;}

now make a new method in your controller TestMethod

        public ActionResult TestMethod()
            return View(new BlogEntry());

        public ActionResult TestMethod(BlogEntry be)
             //send to db
            return View(be);

in your view you need to reference a model at the top of the page, something like:

@model MyProject.ViewModels.BlogEntry

it is important when you use custom inputs like the ckeditor that you fill up id and name attributes on there the same as your model

in this case BlogText so a normal input would look like:

<input type="text" id="BlogText" name="BlogText" />

if you put that within a form tag with a submit button in it it will automaticly fill the model in your controller on post

hope this helps you a little bit :)


Can ypuls eaplian step by step or samples with details.


Dileep Sanker

Hi dileep,

Thanks for your post.

dileep Sanker

Can ypuls eaplian step by step or samples with details.

You can follow this:

Using CKEditor with Razor for .NET MVC 3


and here is a similar thread:


Hope this can be helpful.

Best Regards,


Leave a Reply