Click here to Skip to main content
15,884,794 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Friends,

i have some problem when impliments projects.My problem is how to create text editor just like i am writing in this text box i can do in this text bold,underline,big,small we have always used this option in this editor just like i want to impliments this type of editor by classic asp and vb script.i didnt idea about this type of functionality how to do.

Thanks in advanced !!
Posted
Comments
Peter Leow 21-Jan-15 9:06am    
Why classic asp and vb script? It has been asp.net since 2002.

1 solution

It's possible and beneficial to do all the file editing operation in Javascript, without post back. Only in rare cases, for one or another reason, posting to the site would be required: if one needs to submit the text being edited for some complex server-side operation; other requests would be "get", and also pretty rare, if any at all.

Therefore, having ASP.NET, ASP, or any other server-side technology does not matter much.

Now, here is the basic idea. Write this simple code sample in HTML:
HTML
<p contenteditable="true">This is an editable paragraph.</p>

(The sample is taken from http://www.w3schools.com/tags/att_global_contenteditable.asp[^].)

If click on this paragraph and you try to paste some colored/formatted fragment text, you will see that different colors and fonts will work. Try also this:
HTML
<p contenteditable="true">This is an editable paragraph. <span style="color:red">This text is colored.</span></p> 


This is how you can develop a whole HTML editor with styles and all formatting features. You just need to create some menu/toolbar with styles and format; and the clicks on those menu items or toolbar buttons should modify the content with appropriate styles. You can also add CSS editor (can be simple text editor).

Also, you can find a good number of Javascript HTML editors and see how it all works. See, for example, this one:
http://en.wikipedia.org/wiki/TinyMCE[^],
http://www.tinymce.com/[^].

—SA
 
Share this answer
 

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