How to Integrate CKEditor with ASP.Net

 

Introduction

Today, I am going to describe an easy way to integrate CkEditor with ASP.NET web projects. 

If you’ve not heard of CKEditor, it’s a free and open-source rich text HTML editor for use on websites such as this one. In fact, I’m typing into a CKEditor text box right now as I write this article via our administration back-end of the website. It’s useful for Content Management Systems, Blogs, or anywhere else where you need you users to be able to enter rich text and change styles such as font, size and colour but without the need for technical expertise. Even for those of us who are happy using HTML, it is still a far more elegant and professional-looking way of entering content into a website.

Simply Follow the following steps :

 

Step1.

Create a new ASP.NET website and name it as Demo_application.

Step 2.

Download Ckeditor from here and Extract Ckeditor to the root Folder of your Application.

Step 3.

Add Reference of the javascript files to the head section of your .aspx page.

<script type="text/javascript" src="ckeditor/ckeditor.js"></script>

Step 4.

Add CkEditor TextBox to your .aspx page like below with ID "editor1".

<textarea id="editor1" name="editor1" rows="10" cols="80">
                This is my textarea to be replaced with CKEditor.
</textarea>

Step 5.

Use the CKEDITOR.replace() method to replace the existing <textarea> element with CKEditor.

 <script>
 CKEDITOR.replace('editor1');
 </script>

View Full Code Below

Step 6.

Debug your Application to see the results.

Give your Valuable Comments.
comments powered by Disqus
 
Follow me on twitter
About Me
Harpreet Singh
I began programming with C++ when i was 17. Then at the middle of my study .NET came. Then I began to read C# and VB.NET. By the time i learnt SQL and ASP.NET, and developed some websites such as news portals that are active now. Currently i am running my own Software company.
More Articles