views:

430

answers:

2

I am creating an editor in asp.net MVC application using ckeditor. In textarea i have just written "Sample Text", but when i load the ckeditor and click on source button of ckeditor it gives me a lot of html like html > body > p > [Sample Text]. Why its creating extra html tags?? i have to send the content to database for saving html but ckeditor is adding extra markups.

any workaround? or what i am doing worng?

A: 

People are usually using WYSIWYG editors on the web sites to let people enter some nice looking text.

To do that the editor is automatically wrapping the text that was entered by the consumer with the html tags. In this way, when the text will be then shown separately on the page, it will look exactly like you entered it.

There is no way of how to make the text looks great without using html tags. If you don't believe, open simple notepad editor and try to create nice looking text with paragraphs, images, etc. You couldn't do that.

So, at the very end, after editing of the text in WYSIWYG editor complete, the editor prepares entered text wrapped with HTML.

In other words, you will always has HTML if you use WYSIWYG editor.

If you don't want html, use simple textarea or text input tag on the page.

Andrey Tagaew
No, TinyMCE dose not add extra html tags.
coure06
+1  A: 

If it outputs html and body tags it's because you have set the fullPage to true (the default is false as most of the people don't want that)

AlfonsoML
You are gr8. Thats what i was looking for.
coure06