Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Develop .NET apps in a breeze (Part-2)

Telerik RadEditor

 

RadEditor was chosen by Microsoft to use in MSDN, CodePlex, TechNet, MCMS and even as an alternative to the default editor in SharePoint.  It comes with spellchecker and content authoring environment.  The output is clean XHTML, fast rendering and has widest cross-browser support.

Syntax:

<telerik:RadEditor ID="RadEditor1" runat="server" ToolbarMode="Default" ToolsFile="RadEditorForm_ToolsFile.xml">
</telerik:RadEditor>

 

RadEditor  Components

RibbonToolBar

Syntax:

<telerik:RadEditor ID="RadEditor1" runat="server" ToolbarMode="RibbonBar" ToolsFile="RadEditorForm_ToolsFile.xml">
</telerik:RadEditor>

 

Spell Checker:

To enable Spell Checker in the web application:

1.   Copy the required dictionary files in the project’s App_Data folder:

The files are located in <RadControls for ASP.NET AJAX installation folder>\App_Data\RadSpell.
Create a RadSpell folder in your project’s App_Data folder and copy the dictionaries there.

2.   Add the SpellCheck handler in the web.config file. This can be done with the following techniques:

  • Manually add the handler in your web.config file (in the httpHandlers section):
      <add verb="*" validate="false" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler, Telerik.Web.UI"/>
  • Use the RadEditor’s Smart Tag in Visual Studio. Note that the smart tag will appear only if you have the Telerik.Web.Design.dll file in your project’s bin folder or in the GAC.

 

Syntax:

<telerik:RadEditor runat="server" ID="RadEditor1">
    <Languages>
        <telerik:SpellCheckerLanguage Code="fr-FR" Title="French" />
    </Languages>
</telerik:RadEditor>

Cleaning Word Formatting:

1. Strip Word-formatting on paste

The “Paste from Word” button  allows us to strip the Word-specific tags from the text copied in the clipboard and will paste it in RadEditor with a single click.

 

2. Strip Word-formatting on paste (cleaning fonts and sizes)

The “Paste from Word cleaning fonts and sizes” button  will clean all Word-specific tags and will remove font names and text sizes, as they are rarely used in the web environment.

 

3. Forced format stripping on Paste

Developers can now enforce content formatting using the new StripFormattingOptions property.  As a result, format stripping will be applied to all pasted content, with the following options:

  • None
  • MSWord (retains fonts and sizes)
  • MSWordNoFonts
  • MSWordRemoveAll
  • CSS
  • Font
  • Span
  • All

 

4. Word Content in Clipboard Interception

In case the user is trying to paste Word content with the regular Paste button or Ctrl+V, a dialog will prompt whether the Word markup should be cleaned. If the Clipboard content does not come from Word, the dialog will not be shown.

 

5. Strip Word-formatting after paste

As an alternative to the “Paste from Word” tool (item 1) you may paste the formatted content first and then strip it using the “Format Stripper” tool.

 

6. Paste plain text

The “Paste Plain Text” button  works similarly to “Paste from Word” , but it removes all HTML formatting and pastes plain text, preserving the line breaks.

 

7. Paste as HTML

This new tool  allows you to paste the HTML content of the Clipboard as code, which may be quite convenient for developer-oriented applications (e.g. support systems, forums, etc.)

 

 

Syntax:

<telerik:RadEditor runat="server" ID="RadEditor2" Width="420" Height="200" EnableResize="false">
  <Tools>
    <telerik:EditorToolGroup>
    <telerik:EditorTool Name="Paste" />
    <telerik:EditorTool Name="PasteFromWord" />
    <telerik:EditorTool Name="PasteFromWordNoFontsNoSizes" />
    <telerik:EditorTool Name="PastePlainText" />
    <telerik:EditorTool Name="PasteAsHtml" />
    </telerik:EditorToolGroup>

    <telerik:EditorToolGroup>
    <telerik:EditorTool Name="FormatStripper" />
    </telerik:EditorToolGroup>
  </Tools>
</telerik:RadEditor>


 


This post first appeared on KALS Information Systems Ltd - Technology Is Via, please read the originial post: here

Share the post

Develop .NET apps in a breeze (Part-2)

×

Subscribe to Kals Information Systems Ltd - Technology Is Via

Get updates delivered right to your inbox!

Thank you for your subscription

×