Javscript Based Editor to use in ASP.Net
Please note that, this is not a 100% working source code for Rich Text Editor. However if you are just looking for an editor which supports hyperlinks and few word formatting. This article will be helpful for you to proceed.
IFRAME Based Approach
It is basically very easy to build a simple editor using IFRAME. But the real trouble comes in when trying to build a editor which supports most of the word processing application.
Bring the IFRAME to Editable using designMode
IFRAME can be used as a editor once the design mode is set as on as shown in the following code.
<IFRAME ID="EditorFrame"></IFRAME> <SCRIPT> frames.myEditor.document.designMode = "On" </SCRIPT>
Built in shortcuts to format
The basic formatting like bold, italics, and underline can be done with the shortcuts CTRL +B, CTRL + I, CTRL+U respectively. All the fully qualified URLS will be considered as hyperlinks once after pressing enter or pasting (next to the hyperlink). So without much code you can start using the IFRAME as a editor.
Adding Toolbar to the editor
Still need more functionality like adding images and formatting using a tool bar? You may use the commands to fire
var EditorFrame = frames. EditorFrame.document.selection.createRange()